File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/schemagen Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -682,6 +682,8 @@ public Connection obtainConnection() throws SQLException {
682
682
683
683
@ Override
684
684
public void releaseConnection (Connection connection ) throws SQLException {
685
+ // NOTE : reset auto-commit, but *do not* close the Connection. The application handed us this connection
686
+
685
687
if ( ! wasInitiallyAutoCommit ) {
686
688
try {
687
689
if ( jdbcConnection .getAutoCommit () ) {
@@ -763,6 +765,7 @@ public void releaseConnection(Connection connection) throws SQLException {
763
765
);
764
766
}
765
767
768
+ // Reset auto-commit
766
769
if ( ! wasInitiallyAutoCommit ) {
767
770
try {
768
771
if ( jdbcConnection .getAutoCommit () ) {
@@ -773,6 +776,9 @@ public void releaseConnection(Connection connection) throws SQLException {
773
776
log .info ( "Was unable to reset JDBC connection to no longer be in auto-commit mode" );
774
777
}
775
778
}
779
+
780
+ // Release the connection
781
+ connectionProvider .closeConnection ( jdbcConnection );
776
782
}
777
783
778
784
@ Override
You can’t perform that action at this time.
0 commit comments