Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DB transactions committed by CMT even after DB Connection closure  RSS feed

 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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.
 
Claude Moore
Ranch Hand
Posts: 862
8
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!