Atomikos Forum |
|
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? |