Fix for #163 - Remove detection of autocommit=true from JdbcTransaction

This commit is contained in:
rbygrave
2014-07-09 22:24:28 +12:00
parent 394dfc96d1
commit 17f7143447
@@ -50,11 +50,6 @@ public class JdbcTransaction implements SpiTransaction {
*/
protected final boolean explicit;
/**
* Set to true if the connection has autoCommit=true initially.
*/
protected final boolean autoCommit;
/**
* Behaviour for ending query only transactions.
*/
@@ -140,10 +135,6 @@ public class JdbcTransaction implements SpiTransaction {
this.explicit = explicit;
this.manager = manager;
this.connection = connection;
this.autoCommit = connection.getAutoCommit();
if (this.autoCommit) {
connection.setAutoCommit(false);
}
this.onQueryOnly = manager == null ? OnQueryOnly.ROLLBACK : manager.getOnQueryOnly();
this.persistenceContext = new DefaultPersistenceContext();
@@ -512,14 +503,6 @@ public class JdbcTransaction implements SpiTransaction {
} catch (SQLException e) {
logger.error("Error setting to readOnly?", e);
}
try {
if (this.autoCommit) {
// reset the autoCommit status prior to returning to pool
connection.setAutoCommit(true);
}
} catch (SQLException e) {
logger.error("Error setting to readOnly?", e);
}
try {
connection.close();
} catch (Exception ex) {