mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge pull request #316 from castovoid/master
Resolve NullPointerException on JtaTransacionManager constructor
This commit is contained in:
@@ -115,7 +115,7 @@ public class JdbcTransaction implements SpiTransaction {
|
||||
/**
|
||||
* Set to true if the connection has autoCommit=true initially.
|
||||
*/
|
||||
protected final boolean autoCommit;
|
||||
protected boolean autoCommit;
|
||||
|
||||
protected IdentityHashMap<Object, Object> persistingBeans;
|
||||
|
||||
@@ -146,11 +146,13 @@ public class JdbcTransaction implements SpiTransaction {
|
||||
this.batchOnCascadeMode = manager == null ? PersistBatch.NONE : manager.getPersistBatchOnCascade();
|
||||
this.onQueryOnly = manager == null ? OnQueryOnly.ROLLBACK : manager.getOnQueryOnly();
|
||||
this.persistenceContext = new DefaultPersistenceContext();
|
||||
this.autoCommit = connection.getAutoCommit();
|
||||
if (this.autoCommit) {
|
||||
connection.setAutoCommit(false);
|
||||
|
||||
if (connection != null) {
|
||||
this.autoCommit = connection.getAutoCommit();
|
||||
if (this.autoCommit) {
|
||||
connection.setAutoCommit(false);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new PersistenceException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user