You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Hamilton Verissimo de Oliveira (Engenharia - SPO)" <ha...@agenciaclick.com.br> on 2004/04/06 21:25:15 UTC

Re: [jira] Commented: (GERONIMO-161) LocalXAResourceInsertionInte rceptor could use XAResource implementation

-----Mensagem original-----
De: David Jencks [mailto:david@coredevelopers.net]

> In other words,  if an adapter supports getXAResource it MUST support 
> getLocalTransaction.

Didn't know that. Thanks.

> I don't see why a jdbc LocalTransaction should use XAResource.  I would 
> think it would use java.sql.connection.setAutocommit for begin and the 
> connections commit/rollback methods.

Hey, no. In my case - for instance - I'm dealing with an OracleXADataSource,
I don't want to handle anything with commit in its name :-)  
No autocommit and things like this. I'll leave everything to Oracle.

> I think that, for an adapter that supports xa, if you want to use only 
> local transactions, you should explicitly say this by deploying it with 
> the useLocalTransactions flag set to true.  

Maybe the semantic of useLocalTransactions is missing. I think
useLocalTransactions means that one won't bother to pass transaction
contexts to remote machines. Thats it. On the other hand with or without
useLocalTransactions flag set, the transaction should use the XAResource
implemented by the datasource - when available. If its not available, no
problem to create a wrapper using setAutocommit/et al.


> I haven't looked very hard at your openejb patch yet, but I think that 
> supplying separate wrappers for non-xa and xa jdbc implementations is a 
> good idea.  


Non-XA: JdbcManagedConnectionFactory
XA: JdbcTransactionalManagedConnectionFactory

Thats what I tried to achieve, although the getLocalTransaction is returning
an exception if invoked :-(

> I think that trying to unify everything in one 
> implementation will be too hard to maintain.  

+1


Regards,
hammett


Re: [jira] Commented: (GERONIMO-161) LocalXAResourceInsertionInte rceptor could use XAResource implementation

Posted by David Blevins <da...@visi.com>.
On Tue, Apr 06, 2004 at 04:25:15PM -0300, Hamilton Verissimo de Oliveira (Engenharia - SPO) wrote:
> -----Mensagem original-----
> De: David Jencks [mailto:david@coredevelopers.net]
> 
> > In other words,  if an adapter supports getXAResource it MUST support 
> > getLocalTransaction.
> 
> Didn't know that. Thanks.
[snip]
>
> Maybe the semantic of useLocalTransactions is missing. I think
> useLocalTransactions means that one won't bother to pass transaction
> contexts to remote machines. Thats it. On the other hand with or without
> useLocalTransactions flag set, the transaction should use the XAResource
> implemented by the datasource - when available. If its not available, no
> problem to create a wrapper using setAutocommit/et al.

LocalTransactions are in the J2CA spec explicitly to avoid the
overhead of XA and distributed transactions when it is known in
advance no other datasources are involved.

-- 
David Blevins