patreek / marketbilling

Automatically exported from code.google.com/p/marketbilling
0 stars 0 forks source link

Patch for /src/com/example/dungeons/PurchaseDatabase.java #36

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
mDb and mDatabaseHelper should be static to be reusable by all instances of 
PurchaseDatabase. Doing so will force all threads that create a 
PurchaseDatabase to reuse the same connection which will be internally 
serialized by the connection class. Without this change, each thread gets it's 
own independent connection requiring YOU to do the serialization which is not 
currently being done. The result is that multiple operations may find 
themselves failing due to the db being locked by another thread. See 
http://stackoverflow.com/questions/2493331/what-is-best-practice-with-sqlite-and
-android/2493839 

Original issue reported on code.google.com by cjse...@gmail.com on 20 Jul 2011 at 12:48

Attachments: