Error while executing 'onCleanup' class destructor with sqlwrite() to PostgreSQL
5 views (last 30 days)
Show older comments
Hello Friends,
i am using sqlwrite() in a Matlab App.
% csvDataToImport is a table
sqlwrite(app.conn, 'my_SQLTable', csvDataToImport)
The connection works fine.
The connection is open until the App is closed than the connection gets closed "close(app.conn)".
However when this line is executed i get following error.
Warning: The following error was caught while executing 'onCleanup' class destructor:
Error using database.jdbc.connection/sqlwriteHook>@()close(metaStmt)
Java exception occurred:
java.lang.ClassCastException
at
java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.throwAccessCheckException(AtomicIntegerFieldUpdater.java:475)
at
java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.accessCheck(AtomicIntegerFieldUpdater.java:466)
at
java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.compareAndSet(AtomicIntegerFieldUpdater.java:488)
at org.postgresql.jdbc.PgStatement.close(PgStatement.java:679)
Error in onCleanup/delete (line 25)
obj.task();
Error in database.jdbc.connection/sqlwriteHook (line 22)
c = onCleanup(@()closeStatement(insertStmt));
Error in database.relational.connection/sqlwrite (line 187)
sqlwriteHook(conn,tablename,data,columnnames,newTableCreated)
It still works (csvDataToImport is written in the PostgreSQL Databank).
I am using the newest JDBC driver and do not have problems with other commands like exec() or fetch().
How do i fix this error?
Thank you a lot for heling me!
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!