• No replies
1 Post

Pinned topic Connection pool and transactions

‏2011-08-15T16:49:33Z |
I wrote a JCA resource adapter for an ECM back-end system (Enterprise Content Management). I included support for XA transactions.

I was wondering how WebSphere is managing connections who are enlisted in a XA transaction. I wrote a web application which is using the resource adpater (RA). Let's assume that I have a servlet that performs the following actions:

1. getConnection()
2. do something with RA
3. close()
4. getConnection()
5. do something again with RA
6. close()

All actions are performed inside a XA transaction (started and committed in a servlet filter).

Let's assume that two requests A and B are processed at more or less the same time. Request A finished step 3, then comes request B and does step 4: is it possible that request B gets the connection that was just closed by request A? Or does WebSphere (or any other JEE container for that matter) guarantee that this will not happen?

My tests seem to suggest that WebSphere will not give the connection of request A to request B while the transaction is in progress, which is what I expected. But I need to be sure this will never happen.


PS. I'm using WebSphere 8 in case it matters