brodysoft/Cordova-SQLitePlugin — pull request #82 by nolanlawson (2014-07-08 04:12:02+00:00)
Title: Support concurrent transactions

This is an interesting problem that's not easy to solve, so I'm seeking a little feedback here.

Basically the issue is that this plugin is currently not equipped to handle the case where two `db.transaction`s are happening at the same time. One can rollback, the other one might not, but in either case they're not supposed to share each other's data.

The [first commit](https://github.com/nolanlawson/Cordova-SQLitePlugin/commit/c02b6099435ac18d1c50e755ce375cc71144f9c2) shows a failing test that passes with the standard `openDatabase` DB but not with this plugin.

The second commit fixes the problem in Android. Note that it is still broken in iOS and I couldn't test in WP.

An interesting side effect of the Android fix is that I was also able to use `bg=true` as the default for Android. So no more the thread pool warnings: https://github.com/brodysoft/Cordova-SQLitePlugin/issues/74.

Currently I'm at a crossroads, because the problem is that I'm a JavaScript and Java developer who doesn't know much Objective-C or C#. I think this might be best fixed in the individual native implementations (for performance reasons), but if nobody can step up to implement it, then I think I'll have to write a general-purpose transaction handler in the CoffeeScript instead. Thoughts?