[Bugfix] Don't close unopened connection
When a PostgreSQL transaction is opened without any objects being modified or queried, then the connection won't be opened, thus no need to close it.
This commit is contained in:
parent
9555f562fa
commit
692f80fa61
|
@ -51,11 +51,12 @@ public class PostgreSqlStrolchTransaction extends AbstractTransaction {
|
||||||
this.resourceDao.commit(txResult);
|
this.resourceDao.commit(txResult);
|
||||||
|
|
||||||
// then commit the SQL connection
|
// then commit the SQL connection
|
||||||
if (this.connection != null)
|
if (this.connection != null) {
|
||||||
this.connection.commit();
|
this.connection.commit();
|
||||||
|
|
||||||
// and close the connection, but not catching, as otherwise we can't rollback in exception case
|
// and close the connection, but not catching, as otherwise we can't rollback in exception case
|
||||||
this.connection.close();
|
this.connection.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue