Hi,

Well...I don't agree with the Hardeep point of view in that it's not
possible and will degrade performance by using EJB. First of all one could
use the Session EJB (even one can use it in an Entity bean though it doesn't
seem realistic as Entity EJB is mapped to a single DB table. However there
might be a scenario where it's required to access a different database
through a helper function based on the required functionality, but of course
it's not possible to map an entity EJB to multiple databases) in an
application that involves transactions across multiple databases (that is
one of the real scenario). As far as the connection pool management is
concerned it is handled on part of the specific EJB application server. The
EJB specification does allow to define multiple DB connection pools for an
EJB, and all of these pools are then available for use in EJB component.

As far as performance issue is concerned it is quite context dependent and
one need to think about the required functionality, specific scenario and
then what is the best design pattern to use. So we can't make it a rule that
using a Session EJB in a scenario that involves multiple databases is not
appropriate and shouldn't be recommended. Hence in one scenario it might be
more efficient to make use of Session EJB but in a different scenario one
could possibly make use of simple Java data object (or some other mechanism)
for efficient database interaction.

Thanks

Zahid.

----- Original Message -----
From: Hardeep Singh <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 18, 2001 12:27 PM
Subject: Re: EJB accessing multiple databases selected dynamically


> Hi,
>
> I dont think this is possible... Use of Beans in such a senario will
degrade
> performance.
>
> Thanx,
> Hardeep
>
> ----- Original Message -----
> From: "Sanjay Saluja"
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, September 18, 2001 12:49 PM
> Subject: EJB accessing multiple databases selected dynamically
>
>
> > Hi All,
> >
> > We need to build a project that needs to multiple databases which are
> > specified through the user interface.(i.e. a user can dynamically
provide
> a
> > database at runtime).
> >
> > Can we use EJB in scuh scenario. Do we gain advantage because instance
> > pooling or database connection pooling might need to be done away with.
> > What about a session bean being used in this case. if so how do we
> > efficiently handle database connections.
> >
> >
> > Is there any third party utility (pref. java based and free) that can
pool
> > connection to multiple databases selected  dynamically such as Poolman.
> >
> > Thanks
> > Sanjay
> >
> >
>
===========================================================================
> > 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".
>
>

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