This is occurring for me when I change my HSQLDB dependency from 2.5.1 to 2.7.1 - I need to do this becuase of CVEs on the older version. Here's the error I get when I make a connection:
I also updated my HSQLDB library to v2.7.1 due to CVE-2022-41853.
However, when the HsqlException occurs, you can solve that issue by setting the following system property (before establishing the database connection):
System.setProperty("hsqldb.method_class_names", "net.ucanaccess.converters.*"); // see http://hsqldb.org/doc/2.0/guide/sqlroutines-chapt.html#src_jrt_access_control
Hope, this helps :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks @Alexander. This does fix the user privilege issue.
We've encountered what seems like a more underlying issue when sending UPDATE or DELETE statements to net.ucanaccess.jdbc.UcanaccessStatement.executeBatch():
java.lang.NullPointerException: Cannot invoke "jdbc.ucanaccess.shaded.org.hsqldb.Statement.getTableNamesForRead()" because "<parameter1>.sessionContext.currentStatement" is null
at jdbc.ucanaccess.shaded.org.hsqldb.TransactionManagerCommon.endActionTPL(Unknown Source)
at jdbc.ucanaccess.shaded.org.hsqldb.TransactionManager2PL.completeActions(Unknown Source)
at jdbc.ucanaccess.shaded.org.hsqldb.Session.endAction(Unknown Source)
at jdbc.ucanaccess.shaded.org.hsqldb.Session.executeCompiledStatement(Unknown Source)
at jdbc.ucanaccess.shaded.org.hsqldb.Session.executeCompiledBatchStatement(Unknown Source)
at jdbc.ucanaccess.shaded.org.hsqldb.Session.execute(Unknown Source)
at jdbc.ucanaccess.shaded.org.hsqldb.jdbc.JDBCPreparedStatement.executeBatch(Unknown Source)
at net.ucanaccess.jdbc.ExecuteUpdate.executeWrapped(ExecuteUpdate.java:61)
at net.ucanaccess.jdbc.AbstractExecute.executeBase(AbstractExecute.java:264)
at net.ucanaccess.jdbc.ExecuteUpdate.executeBatch(ExecuteUpdate.java:53)
at net.ucanaccess.jdbc.UcanaccessStatement.executeBatch(UcanaccessStatement.java:203)
We've updated HSQLDB to 2.7.2, and this did not occur in 2.5.0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But regarding your NullPointerException I am not able to reproduce that error (everything works fine).
When I walk with the debugger into the HSQLDB TransactionManager class, I get the following stack trace:
at java.base/java.lang.Thread.dumpStack(Thread.java:2209)
at java.base/java.util.concurrent.atomic.AtomicLong.get(AtomicLong.java:104)
at org.hsqldb.TransactionManager2PL.getSystemChangeNumber(Unknown Source)
at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
at org.hsqldb.Session.executeCompiledBatchStatement(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.executeBatch(Unknown Source)
at net.ucanaccess.jdbc.ExecuteUpdate.executeWrapped(ExecuteUpdate.java:61)
at net.ucanaccess.jdbc.AbstractExecute.executeBase(AbstractExecute.java:264)
at net.ucanaccess.jdbc.ExecuteUpdate.executeBatch(ExecuteUpdate.java:53)
at net.ucanaccess.jdbc.UcanaccessStatement.executeBatch(UcanaccessStatement.java:203)
at [...] MyTests.TestUCanAccessBatch(MyTests.java:1337)
We can see that in your configuration the HSQLDB class is a shaded one: jdbc.ucanaccess.shaded.org.hsqldb.TransactionManagerCommon.
Obviously that might be the root cause of your NullPointerException. I'd recommend to check your classpath for libraries which interfere with your UCanAccess and HSQLDB driver.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is occurring for me when I change my HSQLDB dependency from 2.5.1 to 2.7.1 - I need to do this becuase of CVEs on the older version. Here's the error I get when I make a connection:
We have run into this as well; is it likely that a new UCanAccess release will be issued to address this?
I also updated my HSQLDB library to v2.7.1 due to CVE-2022-41853.
However, when the HsqlException occurs, you can solve that issue by setting the following system property (before establishing the database connection):
Hope, this helps :-)
Thanks @Alexander. This does fix the user privilege issue.
We've encountered what seems like a more underlying issue when sending UPDATE or DELETE statements to
net.ucanaccess.jdbc.UcanaccessStatement.executeBatch():We've updated HSQLDB to 2.7.2, and this did not occur in 2.5.0.
I'm glad it fixed your problem partially 😊
But regarding your
NullPointerExceptionI am not able to reproduce that error (everything works fine).When I walk with the debugger into the HSQLDB TransactionManager class, I get the following stack trace:
We can see that in your configuration the HSQLDB class is a shaded one:
jdbc.ucanaccess.shaded.org.hsqldb.TransactionManagerCommon.Obviously that might be the root cause of your
NullPointerException. I'd recommend to check your classpath for libraries which interfere with your UCanAccess and HSQLDB driver.