mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix for #163 - Remove detection of autocommit=true from JdbcTransaction
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user