This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch AOO50X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO50X by this push:
     new ab35ca9f0c sdbc_jdbc: allow createStatement while dispose notifies 
listeners
ab35ca9f0c is described below

commit ab35ca9f0c4b14dc3082c9b0905e0849660c29ea
Author: Jim Jagielski <[email protected]>
AuthorDate: Sat Nov 7 11:18:01 2026 -0500

    sdbc_jdbc: allow createStatement while dispose notifies listeners
    
    The HSQLDB driver sends SHUTDOWN from its disposing() listener; 
checkDisposed()
    refused it, so an embedded database was never shut down on close!
---
 .../src/main/java/com/sun/star/comp/sdbc/JavaSQLConnection.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/main/connectivity/java/sdbc_jdbc/src/main/java/com/sun/star/comp/sdbc/JavaSQLConnection.java
 
b/main/connectivity/java/sdbc_jdbc/src/main/java/com/sun/star/comp/sdbc/JavaSQLConnection.java
index 39538857e4..8baf1d8e48 100644
--- 
a/main/connectivity/java/sdbc_jdbc/src/main/java/com/sun/star/comp/sdbc/JavaSQLConnection.java
+++ 
b/main/connectivity/java/sdbc_jdbc/src/main/java/com/sun/star/comp/sdbc/JavaSQLConnection.java
@@ -35,6 +35,7 @@ import com.sun.star.beans.PropertyValue;
 import com.sun.star.comp.sdbc.classloading.ClassLoaderAndClass;
 import com.sun.star.comp.sdbc.ConnectionLog.ObjectType;
 import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.XMultiServiceFactory;
 import com.sun.star.lang.XServiceInfo;
@@ -175,7 +176,10 @@ public class JavaSQLConnection extends ComponentBase
 
     @Override
     public synchronized XStatement createStatement() throws SQLException {
-        checkDisposed();
+        // not checkDisposed(): the HSQLDB driver sends SHUTDOWN from its 
disposing() listener
+        if (bDisposed) {
+            throw new DisposedException();
+        }
         logger.log(LogLevel.FINE, Resources.STR_LOG_CREATE_STATEMENT);
         JavaSQLStatement statement = new JavaSQLStatement(this);
         statements.put(statement, statement);

Reply via email to