Multiple databases for persistance


EJB programming & troubleshooting: Multiple databases for persistance

  1. Multiple databases for persistance (3 messages)

    hi. My requirement seems a bit complicted to me and hence in need of a solution. There are 5 databases(sybase) available with the same table structure and design across. The clients(web client)are grouped with respect to some attributes and each group has its own database allocated. The web tier passes the data for persistance specifying which database it should get persisted. I follow the wrapper design by wrapping the BMP with session bean. Now how shall I handle the persistance with the usual feature of re-usability and transactional features. Should I add the database name as an instance variable in the BMP or should i handle the connection and persistance at each buisness method level. If second method, how shall the bean maintain its state for an entity per database ???

    Is there any other method to solve this requirement with no compromise in performance ??


    Threaded Messages (3)

  2. Multiple databases for persistance[ Go to top ]

    EJBs are reusable components. Why don't you just create 5 seperate deployments, each with the settings necessary for the specific type of client?
    Modern App servers should be able to deal with that without any major overheads.

  3. Multiple databases for persistance[ Go to top ]

    As of now, i knew it is just 5 databases. But in near future while enhancing it is going to expand and the databases allocated are going to be dynamic. Then I think, seperate EJBs for each client group is going to be tough !!!! what shall i do then ??
  4. Multiple databases for persistance[ Go to top ]

    If you have too many databases then entity beans may not be a feasible solution. One app server couldn't deal with the pooling well if too many DBs are involved, and performance will take a big hit.
    I think that as long as Entity beans are viable, using seperate deployment will be viable as well.
    I think a design using a single entity bean to access seperate databases with the same structure is very questionable. Think twice before you do it. For instance, you will have to expand the PK of each entity to hold the database identifier along with the actual PK.