开发者

Executing sqlite statement.executeBatch(), giving fatal error "EXCEPTION_ACCESS_VIOLATION"

I am using sqlite, while using Statement.executeBatch(), the jvm is crashing and giving following fatal error, There is no problem while using PreparedStatement.executeBatch(). I have created separate connection and Statement object from each update in database. The error is...

#

A fatal error has been detected by the Java Runtime Environment:

#

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d8fde5c, pid=1980, tid=3416

#

JRE version: 6.0_16-b01

Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode, sharing windows-x86 )

Problematic frame:

V [jvm.dll+0xfde5c]

#

If you would like to submit a bug report, please visit:

http://java.sun.com/webapps/bugreport/crash.jsp

#

THE INSERT METHOD IS....

private void runInsert(int records) { Statement stmt = null; try { connection = DriverManager .getConnection("jdbc:sqlite:jdbcbatch.db"); connection.setAutoCommit(false); stmt = connection.createStatement(); for (int i = 0; i < records; i++) { stmt.addBatch("insert into customer values(" + i + ",\"vijith_" + i + "\",\"10th floor kaushik nagar serverspace_" + i + "\"," + i + ",\"11th floor kaushik nagar serverspace_" + i + "\")");

// Execute the batch for INSERT sDate = System.currentTimeMillis(); eDate = 0L; System.out.println("INSERT started at " + sDate); int[] recordsInserted = stmt.executeBatch(); eDate = System.currentTimeMillis(); milli = (eDate - sDate); System.out.println("INSERT ended at " + eDate); System.out.println("INSERT Time Milliseconds= " + milli + " in Seconds= " + milli / 1000); processTime.put("INSERT", milli); if (recordsInserted.length != records) { connection.rollback(); } connection.commit(); } catch (SQLException e) { e.printStackTrace(); System.err.println(e.getMessage()); } finally { try { if (stmt != null) { stmt.close(); } if (connection != null) { connection.close(); } } catch (SQLException e) { System.err.println(e); } } }

can somebody look into my 开发者_开发技巧problem, if you find anything helpful please do forward to me. Thanks in advance.

B. Patel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜