Hello
I have the following scenario with me
There are two different session beans that have methods to insert into two different tables after taking a connection from the container's connection pool. These two beans can be called by the users through two different jsp pages
There is another session bean that incorporates some functionality of inserting into a third table with the help of a connection. It also includes inserting data into the above two tables. Now this session bean after doing the necessary work, calls the above two session beans. The
whole sequnce is in a transaction.
In this case, will there be three connections held up till the time the transaction is over. How do I address this issue? I do not want to hold up so many connections as the number of hits per minute in the product we are developing is very high, and it means that we might have to have
a very large connection pool. What are the alternatives for me to use only one connection per transaction?
Thanks and Regards
Sreehari
-
Holding up connections for a transactions (2 messages)
- Posted by: Sree Hari
- Posted on: March 12 2001 02:15 EST
Threaded Messages (2)
- Holding up connections for a transactions by raghu tss rao on March 12 2001 10:12 EST
- Holding up connections for a transactions by qing yan on March 12 2001 11:45 EST
-
Holding up connections for a transactions[ Go to top ]
- Posted by: raghu tss rao
- Posted on: March 12 2001 10:12 EST
- in response to Sree Hari
Hi,
My understanding is a transaction properties are set on a connection. So if you have a transaction spanning three connections then you need a tranaction manager like tuxedo to manage your transaction.
-
Holding up connections for a transactions[ Go to top ]
- Posted by: qing yan
- Posted on: March 12 2001 11:45 EST
- in response to raghu tss rao
Yes,it is distributed transaction, and the container will
act as transaction manager, but it is expensive and have other consequences you may not expect.
To avoid the problem, one solution might be:
Instead of putting logic in the session bean,put it in
seperate class and use session bean as facade
to those pure java class.
SB_A
{
getConnection(conn);
a(conn);
releaseConnection(conn);
};
SB_B
{
getConnection(conn);
b(conn);
releaseConnection(conn);
};
SB_C
{
getConnection(conn);
a(conn);
b(conn);
releaseConnection(conn);
};