Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLiteException Unknown error

Tags:

android

sqlite

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)

like image 860
user286875 Avatar asked Aug 17 '26 10:08

user286875


1 Answers

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.

like image 110
Josef Pfleger Avatar answered Aug 19 '26 00:08

Josef Pfleger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!