Forum: Building VoltDB Applications

Post: User may have instantiated a SQLStmt inside a stored procedure's run method

User may have instantiated a SQLStmt inside a stored procedure's run method
shetty_ritesh
Sep 24, 2010
Hi VoltDB Team,
I have taken the latest 1.1 version and made changes as per documentation.
I am seeing following error when i execute the insert
===============================================================================
VOLTDB ERROR: UNEXPECTED FAILURE:
SQLStmt objects cannot be instantiated after VoltDB initialization. User may have instantiated a SQLStmt inside a stored procedure's run method.
at com.dnbgp.subject.model.procedures.InsertSubject.run(InsertSubject.java:28)
===============================================================================
at org.voltdb.client.ClientImpl.callProcedure(ClientImpl.java:148)
at com.dnbgp.subject.client.util.SubjectInitialSeed.callProcedure(SubjectInitialSeed.java:157)
at com.dnbgp.subject.client.util.SubjectInitialSeed.processFile(SubjectInitialSeed.java:110)
at com.dnbgp.subject.client.util.SubjectInitialSeed.main(SubjectInitialSeed.java:52)
re: SQLStmt error
tcallaghan
Sep 26, 2010
Ritesh,

Can you please include the actual stored procedure code in a reply to this forum post (or email it to support@voltdb.com if it is proprietary)?

-Tim
SQL statements are analyzed
rbetts
Sep 27, 2010
I apologize. I provided an incorrect answer. I believe a correct answer is:
Statements must be global, and discoverable for analysis, not static. That is, they must be bound to class fields and not to local method scoped variables.
re: User may have instantiated a SQLStmt inside a stored procedu
tcallaghan
Sep 29, 2010
Ritesh,


This has been fixed (you can now use public or private), details at http://issues.voltdb.com/browse/ENG-753

-Tim