couchbaselabs/TouchDB-Android — Issue #3: Replication: "SQLiteException: cannot start a transaction within a transaction"
Author: pilt
Created: 2012-02-14 23:52:08+00:00
State: open

Hi!

I am experimenting with replication and am getting this error.

Source: https://gist.github.com/12d5ccbc01f765eca4f0

### TestAppActivity
```
02-15 00:46:17.565: I/TestAppActivity(22808): deleted old database
02-15 00:46:20.088: I/TestAppActivity(22808): begun replicating
```

### com.couchbase.touchdb.testapp
```
02-15 00:46:27.245: E/SQLiteDatabase(22808): Error inserting docid=97b154a17db503b635b54ecc0f1fdd11
02-15 00:46:27.245: E/SQLiteDatabase(22808): android.database.sqlite.SQLiteException: cannot start a transaction within a transaction
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteStatement.native_executeSql(Native Method)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:90)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1899)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1839)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:661)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteDatabase.beginTransactionNonExclusive(SQLiteDatabase.java:576)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteStatement.acquireAndLock(SQLiteStatement.java:247)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:112)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1718)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1591)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.couchbase.touchdb.TDDatabase.insertDocumentID(TDDatabase.java:1669)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.couchbase.touchdb.TDDatabase.getOrInsertDocNumericID(TDDatabase.java:1679)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.couchbase.touchdb.TDDatabase.forceInsert(TDDatabase.java:1980)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.couchbase.touchdb.replicator.TDPuller.insertRevisions(TDPuller.java:282)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.couchbase.touchdb.replicator.TDPuller$1.process(TDPuller.java:68)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.couchbase.touchdb.support.TDBatcher.processNow(TDBatcher.java:41)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.couchbase.touchdb.support.TDBatcher$1.run(TDBatcher.java:24)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.os.Handler.handleCallback(Handler.java:605)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.os.Handler.dispatchMessage(Handler.java:92)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.os.Looper.loop(Looper.java:137)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at android.app.ActivityThread.main(ActivityThread.java:4340)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at java.lang.reflect.Method.invokeNative(Native Method)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at java.lang.reflect.Method.invoke(Method.java:511)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-15 00:46:27.245: E/SQLiteDatabase(22808):	at dalvik.system.NativeStart.main(Native Method)
```