users@glassfish.java.net

Is XA data source really needed here?

From: <forums_at_java.net>
Date: Wed, 13 Apr 2011 09:25:40 -0500 (CDT)

Hi,


We have an application that consist of muliple persistence technologies (EJB
1.1 entity beans, Hibernate and straight JDBC). For the most parts the
transactional scope is container managed through session beans but we do play
around with the UserTransaction object at times.

We have two JDBC connections pools (each fronted by a JDBC resource). One is
transactional and used by most of the code (entity beans, Hibernate and most
JDBC). The other is specified with nontransactionalconnections=true and is
used for readonly purposes.

In a transaction the code will multiple times lookup the transactional data
source in JNDI and invoke getConnection (some is done declaratively in
session beans). We expect actions on these connection objects returned by the
data source to be carrried out in the same transaction (if a tx already has
benn started). However, this is not the case unless the data source is
specified to be XA capable. Otherwise we experience the transactional scope
not to propagate for example from one session bean to another.

Can it really be right that I have to specify the data source to be XA
capable to get this to work? I have tried
specifying associatewiththread=true on the data source but it does not make
a difference. Multiple connection objects are made and tx scope is not
propagted from session bean to session bean.

 


--
[Message sent by forum member 'mphaua']
View Post: http://forums.java.net/node/791268