Skip to content
This repository has been archived by the owner on Jun 3, 2019. It is now read-only.

Commit

Permalink
Updated to close the transactional driver connection if the driver is…
Browse files Browse the repository at this point in the history
… not in the list of drivers that require modifiers
  • Loading branch information
tomjenkinson committed Jan 12, 2015
1 parent 866db77 commit ef51072
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,7 @@ public void close() throws SQLException

if (!delayClose) // close now
{
if (_theModifier != null)
_transactionalDriverXAConnectionConnection.closeCloseCurrentConnection();
_transactionalDriverXAConnectionConnection.closeCloseCurrentConnection();


if (_theConnection != null && !_theConnection.isClosed())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public list ()
for (String driver : new String[] { "jConnect (TM) for JDBC (TM)",
"Oracle JDBC driver",
"IBM DB2 JDBC Universal Driver Architecture",
"MySQL Connector Java",
"H2 JDBC Driver"}) {
"MySQL Connector Java"}) {
ModifierFactory.putModifier(driver, -1, -1,
IsSameRMModifier.class.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

package com.hp.mwtests.ts.jdbc.basic;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;

import java.sql.Connection;
Expand Down Expand Up @@ -267,7 +268,7 @@ public void test() throws Exception

tx.begin();

conn.isClosed(); // this will blow up the underlying TransactionalDriverXAConnection still thinks its associated with an old txn
assertFalse(conn.isClosed());

if (!reuseconn)
{
Expand Down

0 comments on commit ef51072

Please sign in to comment.