...SQLiteException: unknown error: ROLL

Put your problem here if it does not fit any of the other categories.

...SQLiteException: unknown error: ROLL

Postby szgaljic » Fri Dec 11, 2009 4:42 am

I wrote a class to extend SQLiteOpenHelper and implemented the onCreate method as follows:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Override
  2. public void onCreate(SQLiteDatabase db) {
  3.    db.beginTransaction();
  4.    try{
  5.       createAllTables(db);
  6.       db.setTransactionSuccessful();
  7.    }catch(Exception e){
  8.       e.printStackTrace();
  9.    }finally{
  10.       db.endTransaction();
  11.       if( db != null ) db.close();
  12.    }
  13. }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


My constructor for this class is as follows:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public AndroidDB(Context context, Database database) {
  2.    super(context, database.name, null, database.version);
  3.    getWritableDatabase();
  4.    close();
  5. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


When I instantiate this class I get the following exception..... any ideas:

Code: Select all
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nsx/com.nsx.ListItemsActivity}: android.database.sqlite.SQLiteException: unknown error: ROLLBACK;
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2141)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2157)
     at android.app.ActivityThread.access$1800(ActivityThread.java:112)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1581)
     at android.os.Handler.dispatchMessage(Handler.java:88)
     at android.os.Looper.loop(Looper.java:123)
     at android.app.ActivityThread.main(ActivityThread.java:3739)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:515)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
     at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: unknown error: ROLLBACK;
     at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
     at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1333)
     at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:376)
     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:114)
     at com.nsx.db.AndroidDB.<init>(AndroidDB.java:51)
     at com.nsx.db.NsxDB.<init>(NsxDB.java:16)
     at com.nsx.ListItemsActivity.onCreate(ListItemsActivity.java:26)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1122)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2104)
     ... 11 more
szgaljic
Freshman
Freshman
 
Posts: 5
Joined: Fri Dec 11, 2009 4:31 am

Top

Postby szgaljic » Sat Dec 12, 2009 4:35 pm

bump
szgaljic
Freshman
Freshman
 
Posts: 5
Joined: Fri Dec 11, 2009 4:31 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests