This is an automated email from the ASF dual-hosted git repository.
doebele pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git
The following commit(s) were added to refs/heads/master by this push:
new bedebaae EMPIREDB-386 DBContextBase closeConnection optimized
bedebaae is described below
commit bedebaaeae964a7913d5c8ca5309ca97f3da14a2
Author: Rainer Döbele <[email protected]>
AuthorDate: Tue Feb 28 14:51:18 2023 +0100
EMPIREDB-386
DBContextBase closeConnection optimized
---
.../src/main/java/org/apache/empire/db/context/DBContextBase.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/empire-db/src/main/java/org/apache/empire/db/context/DBContextBase.java
b/empire-db/src/main/java/org/apache/empire/db/context/DBContextBase.java
index e80b683a..2f4f05a0 100644
--- a/empire-db/src/main/java/org/apache/empire/db/context/DBContextBase.java
+++ b/empire-db/src/main/java/org/apache/empire/db/context/DBContextBase.java
@@ -262,8 +262,9 @@ public abstract class DBContextBase implements DBContext
protected void closeConnection()
{ try
{ // close connection
- Connection conn = getConnection();
- conn.close();
+ Connection conn = getConnection(false);
+ if (conn!=null)
+ conn.close();
} catch (SQLException sqle) {
// Commit failed!
throw new EmpireSQLException(getDbms(), sqle);