Discussions

EJB design: Choose DB at runtime?

  1. Choose DB at runtime? (1 messages)

    Anyone have a good pattern to pass the jndi db string into any entity bean at runtime. I am developing a web application using EJB for the business logic/data access tier. For scalability reasons I am partitioning certain data across multiple DB's e.g. user data. Based on the user's id I am going to determine which db the users data is in at runtime. The algorithm I am using is going to allow me to partition the data across n databases. It also allows for seamless repartitioning when the need arises. I am just not sure what the best way is to pass this connection information to the Entity Bean. Thanks for any help in advance.

    Justin
  2. Choose DB at runtime?[ Go to top ]

    How about using BMP and a primary key class which includes datasource name?