Another bugfix release. Now all open bugs and known stacktraces are fixed:
Smaller bugfixes for rare race conditions
This entry was posted on Friday, November 26th, 2010 at 11:21 and is filed under XINGSync. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Hi Dominik,
this is a known problem. The contact database is updated with batch-operations (Android API). However if there is anybody else updating the database as well (e.g. another Sync Adapter) the batch operation is not able to write the contact.
The worst thing that might happen, is that a contact will not be created/updated in this sync cycle but in a later sync cycle.
Hi Daniel,
I still have my logcat full of sqlite Errors, after some contacts had been added.
D/ContactManager( 8106): Add contact: xxx xxx
D/dalvikvm( 8106): GC_FOR_MALLOC freed 6821 objects / 1350656 bytes in 51ms
I/Database( 3102): sqlite returned: error code = 14, msg = cannot open file at source line 25207
I/Database( 3102): sqlite returned: error code = 14, msg = prepared statement aborts at 1: [BEGIN EXCLUSIVE;]
E/Database( 3102): Failure 14 (unable to open database file) on 0x223c78 when executing ‘BEGIN EXCLUSIVE;’
E/DatabaseUtils( 3102): Writing exception to parcel
E/DatabaseUtils( 3102): android.database.sqlite.SQLiteException: unable to open database file: BEGIN EXCLUSIVE;
E/DatabaseUtils( 3102): at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
E/DatabaseUtils( 3102): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1727)
E/DatabaseUtils( 3102): at android.database.sqlite.SQLiteDatabase.beginTransactionWithListener(SQLiteDatabase.java:524)
E/DatabaseUtils( 3102): at com.android.providers.contacts.SQLiteContentProvider.applyBatch(SQLiteContentProvider.java:197)
E/DatabaseUtils( 3102): at com.android.providers.contacts.ContactsProvider2.applyBatch(ContactsProvider2.java:2272)
E/DatabaseUtils( 3102): at android.content.ContentProvider$Transport.applyBatch(ContentProvider.java:216)
E/DatabaseUtils( 3102): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:173)
E/DatabaseUtils( 3102): at android.os.Binder.execTransact(Binder.java:288)
E/DatabaseUtils( 3102): at dalvik.system.NativeStart.run(Native Method)
E/ContactManager( 8106): Cannot create contact
E/ContactManager( 8106): android.database.sqlite.SQLiteException: unable to open database file: BEGIN EXCLUSIVE;
E/ContactManager( 8106): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:158)
E/ContactManager( 8106): at android.database.DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(DatabaseUtils.java:137)
E/ContactManager( 8106): at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:449)
E/ContactManager( 8106): at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:95)
E/ContactManager( 8106): at android.content.ContentResolver.applyBatch(ContentResolver.java:627)
E/ContactManager( 8106): at de.danielweisser.android.xingsync.platform.ContactManager.addContact(ContactManager.java:243)
E/ContactManager( 8106): at de.danielweisser.android.xingsync.platform.ContactManager.syncContacts(ContactManager.java:78)
E/ContactManager( 8106): at de.danielweisser.android.xingsync.syncadapter.SyncAdapter.onPerformSync(SyncAdapter.java:64)
E/ContactManager( 8106): at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:163)
I’m using 2.2.1, Cyanogen Mod, on a G2 – if you need more details just drop me a mail.
Thanks & Regards,
Dominik
Hi Dominik,
this is a known problem. The contact database is updated with batch-operations (Android API). However if there is anybody else updating the database as well (e.g. another Sync Adapter) the batch operation is not able to write the contact.
The worst thing that might happen, is that a contact will not be created/updated in this sync cycle but in a later sync cycle.
This seems to be a known problem (e.g. http://stackoverflow.com/questions/2397959/how-to-avoid-sqliteexception-locking-errors). Other sync adapters (e.g. Funambol sync) use the same implementation but they seem to be hiding the exceptions.
But I might remove statement writing the exception to the log in order not to scare the users
But yes more details are always welcome. Did that really happen during another app was running, that had access to the contacts storage?
Cheers
Daniel