Do you need to get two different transactions - but perhaps things are more
complex.  You can defer referential integrity checking until commit time
which may help, and you can just plain not use it as well.  Just because
something is a foreign key doesn't mean you need to tell the database.  In
fact referential integrity checking can be expensive and you may want to
consider whether you should use it just on that basis.

Cheers

-----Original Message-----
From: Darius Davidavicius [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 21, 2000 12:18 PM
To: jBoss Developer
Subject: Re: [jBoss-Dev] Connection-transaction: feature or bug?


>
>Try this:
>            DataSource ds = (DataSource)new
>InitialContext().lookup("java:comp/env/jdbc/OraclePool");
>            Connection aCon1 = ds.getConnection();
>            aCon1.close();
>            Connection aCon2 = ds.getConnection();
>            aCon2.close();
>
It does not helps me in my my case:

I take aCon1 and do insert into table1
I take aCon2  and trying insert into table2, where table1 has FOREIGN KEY
into table1 and here goes lock of oracle because I GOT DIFFERENT 
connections.


Some investigations:
File: OraclePoll.java 
function: Object getObject()
        here it is called         
              Object result = factory.isUniqueRequest();

File: XAConnectionFactory.java
Function     public Object isUniqueRequest()  ALWAYS returns false if i
using Oracle8i pool because into wrapperTx Oracle conection is never
inserted.

File: XAConnectionFactory.java
Function     public Object prepareObject(Object pooledObject) 
inserts db connection into wrapperTx just of the type     XAConnectionImpl  

How i can make sure i gen get the same data base connections in the same EJB
transaction?

I was looking into source code i could not found the sollution how i can
store all types of connections (not just XAConnectionImpl)

Maybe some class XAOracleConnectionImpl should be implemented with
setTransactionListener ans all ther functios? Otherwise I cant add oracle 
connection into the wrapperTx - connection, transaction association.

Hmm i'm a bit confused...

Regards,
D&D





Reply via email to