Announcement Announcement Module
Collapse
No announcement yet.
User specific database Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • User specific database

    Hi All

    I want to use separate database for each user. There will be a common database MainDB which contains the common tables and a mapping table that maps each username with a database name, but user specific data is available in the corresponding database. [tables in all database have same name and structure].

    Is this possible in hibernate to select location and name of database at runtime?

    Thanks
    Amit Khanna

  • #2
    You can use Hibernate Shards.

    Comment


    • #3
      Hi

      I've read the manual of shards [http://docs.jboss.org/hibernate/stab...n/html_single] and what i understood is that shards require all the database configurations to be available when the application starts up.

      My requirements are different, what I want is that even if a database is created at runtime it should be hangled properly. Lets say a new user is created with username UserA and a database dbUserA is created for the user, when i login as UserA, I should be access tables in dbUserA database without any code changes. Is it possible using Hibernate Shard or any other hibernate based framework?

      Thanks
      Amit Khanna

      Comment


      • #4
        I really don't understand why you try to split your database like this, but then you should rely on your database as some vendor have mechanism to split vertically database.

        The other option I can think of, is to manage connection manually which requires a lot of work...

        Comment

        Working...
        X