users@glassfish.java.net

Re: Sharing a Connection between EJB's

From: Cheng Fang <Cheng.Fang_at_Sun.COM>
Date: Mon, 22 Oct 2007 12:08:31 -0400

glassfish_at_javadesktop.org wrote:
> Thanks for your detailed answer. My problem is that my pool of connection is very limited (for example: 10 connections). When EJB1.xxx() method calls EJB2.yyy() method,
EJB1.xxx() first closes the connection (meaning returning it to pool),
then call EJB2.yyy(), which gets another connection from the pool. So
they are only using 1 at any given time.
> it means that I will use 2 out of my 10 connections and this is what I want to avoid. I want, in this situation, to use only one connection. I'm not sure that bean management transaction is the solution for me or is it?
>
>
Using bean managed transaction is a separate topic from using
connections. With bean managed transaction, you can choose not to
involve any transaction, which I guess is what you want to achieve.
Otherwise, ejb container will automatically demarcate transactions.

-cheng
> Thanks,
> Ron
> [Message sent by forum member 'rong999' (rong999)]
>
> http://forums.java.net/jive/thread.jspa?messageID=241528
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>