AnantLabs / xerial

Automatically exported from code.google.com/p/xerial
0 stars 0 forks source link

PreparedStatement closed after violated (foreign key) constraint. #95

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. executeUpdate a prepared statement violating a foreign key constraint.
2. try to execute the prepared statement with correct values
3. java.sql.SQLException: statement is not executing

What is the expected output? What do you see instead?

The prepared statement should not be closed and continue to be useable.
Instead a java.sql.SQLException: statement is not executing
    at org.sqlite.Stmt.checkOpen(Stmt.java:49)
    at org.sqlite.PrepStmt.clearParameters(PrepStmt.java:51)

Exception is thrown.

After a 

java.sql.SQLException: [SQLITE_CONSTRAINT]  Abort due to constraint violation 
(foreign key constraint failed)
    at org.sqlite.DB.newSQLException(DB.java:383)
    at org.sqlite.DB.newSQLException(DB.java:387)
    at org.sqlite.DB.execute(DB.java:342)
    at org.sqlite.DB.executeUpdate(DB.java:363)
    at org.sqlite.PrepStmt.executeUpdate(PrepStmt.java:85)

Exception the prepared statement should remain functional.

What version of the product are you using? On what operating system?

* 
http://www.xerial.org/maven/repository/artifact/org/xerial/sqlite-jdbc/3.7.2/sql
ite-jdbc-3.7.2.jar

* Windows 7 64bit.

Please provide any additional information below.

Original issue reported on code.google.com by Konrad.L...@gmail.com on 1 Mar 2011 at 1:07

GoogleCodeExporter commented 9 years ago
i am facing a similar issue. reuse of the preparedstatement is an optimization 
without which the running time of my program increase by 20 times.

Original comment by ramthegr...@gmail.com on 5 Jan 2012 at 4:14

GoogleCodeExporter commented 9 years ago
Please fix this. Thanks.

Original comment by szco...@gmail.com on 10 Aug 2013 at 2:29

GoogleCodeExporter commented 9 years ago
Still happening in 3.7.15-M1.

Original comment by sean.roh...@gmail.com on 1 Aug 2014 at 10:49