• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JCA Connection pool and transactions

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 a JEE server 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 the JEE container guarantee that this will not happen?

I did some tests with WebSphere 8 that 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. I couldn't find a definite answer in the JCA specs either.

Any help would be appreciated.
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the reason why anyone would want to use a JEE container. Don't you think so?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Refer to java connector architecture specification 1.6 chapter 7.
Read connection sharing section .
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic