tags:

views:

373

answers:

4

Does anyone know what this means? I'm trying to start a transaction in onActivityResult() to insert a row based on the received result.

03-05 15:39:51.937: ERROR/Database(2387): Failure 21 (out of memory) on 0x0 when preparing 'BEGIN EXCLUSIVE;'.

03-05 15:39:51.967: DEBUG/AndroidRuntime(2387): Shutting down VM 03-05 15:39:51.967: WARN/dalvikvm(2387): threadid=3: thread exiting with uncaught exception (group=0x40013140)

03-05 15:39:51.967: ERROR/AndroidRuntime(2387): Uncaught handler: thread main exiting due to uncaught exception

03-05 15:39:52.137: ERROR/AndroidRuntime(2387): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {com.ozdroid/com.ozdroid.load.LoadView}: android.database.sqlite.SQLiteException: unknown error: BEGIN EXCLUSIVE;

...

03-05 15:39:52.137: ERROR/AndroidRuntime(2387): Caused by: android.database.sqlite.SQLiteException: unknown error: BEGIN EXCLUSIVE;

...

03-05 15:39:52.137: ERROR/AndroidRuntime(2387): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:434)

A: 

"out of memory" seems clear. As for the reason, it's hard to say without more...

dystroy
+2  A: 

I've had this happen to me in two situations:

  1. when SQL statements contain syntax errors
  2. when beginTransaction is called on a not-open database connection

It looks like you've run into number two. Check your syntax and make sure you open() (and don't close()) your database before you call beginTransaction.

And I think we can agree that the resulting logcat error messages are not 100% helpful.

Josef
A: 

josef thank you very much!I just happened along this exception.

kula
A: 

Josef! Thank you! Who could have thought that a db gets out of memory, Failure 21, of being closed?