Darius Davidavicius wrote:
> I have bean managed Entity bean
>
> I do trying to get 2 oracle connections like:
>
> try
> {
> DataSource ds = (DataSource)new
>InitialContext().lookup("java:comp/env/jdbc/OraclePool");
> Connection aCon1 = ds.getConnection();
> Connection aCon2 = ds.getConnection();
> }
Try this:
DataSource ds = (DataSource)new
InitialContext().lookup("java:comp/env/jdbc/OraclePool");
Connection aCon1 = ds.getConnection();
aCon1.close();
Connection aCon2 = ds.getConnection();
aCon1.close();
That should work better.
> dont u think could be done better:
> 1. then connection is created it is stored association db connection-transaction
> 2. when request for new connection happens it should be checked if db connection is
>in use AND IF IT IS IN USE check IF THE SAME TRANSACTION
> ASKING FOR CONNECTION. If transaction the same - the same db connection returned is
>transactions different new db connection is created.
You're absolutely right, and this is indeed handled properly. Check the
.minerva.xa classes.
/Rickard
--
Rickard �berg
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com