Thx for your reply!
Well, the connection is used only from one thread, so there shouldn't
be parallel transactions at any time.
Here's a code fragment what causes the crash (in fact, the .dll
crashes _after_ the connection to the db has been closed, as I see
that in my log file...):
---
DbConnection dbcon = DbConnection.getInstance();
Connection conn =
dbcon.connectToDb(System.getProperty("user.home")+"//database.db");
Statement stmt = conn.createStatement();
Enumeration dbenum = <<<<enumeration_of_my_data>>>>;
conn.setAutoCommit(false);
while (dbenum.hasMoreElements()) {
try {
PreparedStatement prep = conn.prepareStatement("INSERT
INTO abc (xyz) VALUES (?);");
String url = (String)dbenum.nextElement();
prep.setString(1, something);
int resu = prep.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
conn.commit();
try {
PreparedStatement prep =
conn.prepareStatement("DELETE
FROM xyzabc");
prep.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
dbenum = <<<<<another_enumeration_of_my_data>>>>>;
conn.setAutoCommit(false);
while (dbenum.hasMoreElements()) {
try {
prep = conn.prepareStatement("INSERT
INTO abcabc (a,b,c) VALUES
(?,?,?);");
prep.setString(1, something);
prep.setInt(2, something);
prep.setString(3, something);
int resu = prep.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
conn.commit();
conn.setAutoCommit(false);
for (int i=0;i<myarray.size();i++) {
try {
prep = conn.prepareStatement("INSERT INTO xyz (a)
VALUES (?);");
prep.setString(1, something);
int resu = prep.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
conn.commit();
dbcon.closeConnection();
---
Can you see any problems that could be caused by that design?
Would it be better to close the connection after any transaction and
open it afresh to do the next one?
On Aug 21, 6:16 pm, Joe Wilson <[EMAIL PROTECTED]> wrote:
> Without seeing the java program, I'm guessing you're using the same
> connection or prepared statement from multiple threads at the same time.
>
> Although the driver has mutexes for this sort of thing, perhaps something
> was missed.
>
> It would be helpful if you supplied a small java program that can reproduce
> the problem.
>
>
>
> --- sakya <[EMAIL PROTECTED]> wrote:
> > I've got a problem with the native driver.
> > In some circumstances the JVM is crashing caused by an
> > EXCEPTION_ACCESS_VIOLATION in sqlitejdbc.dll. This happens only from
> > time to time, not in every case (for explanation: my application is
> > saving its data periodically from memory to SQlite - only sometimes it
> > crashes doing so).
> > Any idea where the problem could be and how to remedy it?
>
> > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6bb03ca4, pid=2340,
> > tid=2748
> > Current thread (0x02a82400): JavaThread "Finalizer" daemon
> > [_thread_in_native, id=2748]
> > Stack: [0x02c00000,0x02c50000), sp=0x02c4f620, free space=317k
> > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code,
> > C=native code)
> > C [sqlitejdbc.dll+0x43ca4]
> > C [sqlitejdbc.dll+0x1f8a3]
> > C [sqlitejdbc.dll+0x1ed1]
> > J org.sqlite.NativeDB.finalize(J)I
> > J org.sqlite.DB.finalize(Lorg/sqlite/RS;)I
> > J org.sqlite.PrepStmt.finalize()V
> > v ~StubRoutines::call_stub
>
> > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
> > J org.sqlite.NativeDB.finalize(J)I
> > J org.sqlite.DB.finalize(Lorg/sqlite/RS;)I
> > J org.sqlite.PrepStmt.finalize()V
> > v ~StubRoutines::call_stub
> > J java.lang.ref.Finalizer.invokeFinalizeMethod(Ljava/lang/Object;)V
> > J java.lang.ref.Finalizer.runFinalizer()V
> > J java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;)V
> > j java.lang.ref.Finalizer$FinalizerThread.run()V+11
> > v ~StubRoutines::call_stub
>
> ___________________________________________________________________________
> _________
> Sick sense of humor? Visit Yahoo! TV's
> Comedy with an Edge to see what's on, when.http://tv.yahoo.com/collections/222
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---