• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DB transactions committed by CMT even after DB Connection closure

 
Ranch Hand
Posts: 247
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In JBOSS,

I tried out a test program of executing 2 statements in different DB connections(using Connection Pool to Mysql) under Container Managed Transaction control.

First, I did not close the DB Connections. CMT committed the different DB Connection Statement execution with exception

Closing a connection for you. Please close them yourself.

So, manually closed the two connections. Even after the connection closure, Container manages to commit the transaction.

Please give some pointers in this.
 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That seems to be a normal behaviour AFAIK: you have opened two different connections, those connections are closed (and so returned to the datasource they were taken from) and the global transaction, in which both connections were enlisted, has been committed by the container.

The fact that container closed for you an intentionally left opened connection seems to be a good help provided by JBoss, and, so, not a feature you may always rely upon with other J2EE containers.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic