Results 1 to 4 of 4

Thread: User specific database

  1. #1
    Join Date
    Dec 2010
    Posts
    26

    Default 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. #2
    Join Date
    Apr 2011
    Posts
    107

    Default

    You can use Hibernate Shards.

  3. #3
    Join Date
    Dec 2010
    Posts
    26

    Default

    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

  4. #4
    Join Date
    Apr 2011
    Posts
    107

    Default

    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...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •