Rajendra,

Most EJB servers support multiple connection pools. Each pool would supply
connections to a particular database. The connection info for each database is
part of the pool definition. You're beans would only need to know from which
pool to request a connection. The pool identifier can be saved in a bean
property. You can pass the pool identifier in the create method of a session
bean. For entity beans, the most portable solution would be to deploy the same
bean code multiple times with a deployment property identifying the pool. Then
the business logic would use the appropriate home depending on the database
desired.

--Victor Langelo


Rajendra Mishra wrote:

> Hello,
>
>     I am developing a system in which users would be accessing different
> database depending upon some selections. The EJB's need to query into the
> apropriate datatabase accordingly. The way we are doing it is the servlet
> which invokes an EJB methid, passes it a Properties object with all the
> connection info from the client session(httpsession). The EJB (BMP) gets a
> connection from the pool as per the properties passed. This means that the
> ejbLoad/ejbFindByPrimaryKey all are dependent on the Properties info which
> is stored as a class-member variable. Then, before invoking any remote
> interface calls, the client has to call a method to set the connection
> properties again. This whole soln is built on a shaky ground and might fall
> once we go into a production environment.
>
>     I would like to know if we can set some properties which is instance
> specific to a bean. In other words, one bean might want to connect to a
> different database than the other depending upon some business logic before
> a handle to the home object is looked up. Is this possble? Please help me
> with some leads.
>
> Thanks.
> Raaj.
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to