Atomikos Forum

Multiple ongoing transactions

Hi,  I am using the AtomikosDataSourceBean method of instantiating a userTransaction, creating connections, then committing or rolling back.

My question is how I can write tests which simulate multiple ongoing transactions.  I have a class  which contains the AtomikosDataSourceBean bean objects for each database and has a start and close method to start and end the UserTransaction utx.

However, if I make two of these encapsulating, and try to start and end their UserTransactions individually, only after the second UserTransaction commits do I see any effect on the database. In other words, it seems as though there is just a single UserTransaction object being shared by everyone.

How can I prepare a program, for example, that can simulate multiple ongoing transactions?  This may be a lack of understanding of XA protocol on my part.  But I seem to recall that transactions should have different IDs and should not merge in this manner - how is this implemented in Atomikos?
P. Eswaran Send private email
Wednesday, August 24, 2011
 
 
Note that I have been following the sample code by using this sort of construct: UserTransaction utx = new UserTransactionImp();

On certain pages on the Atomikos webpage I see the use of TransactionManager and UserTransactionManager instead replacing this, which I am not sure of the significance.
P. Eswaran Send private email
Wednesday, August 24, 2011
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics