Error while executing 'onCleanup' class destructor with sqlwrite() to PostgreSQL
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Database Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!