Re: [android-developers] Re: SQLite & concurrent access best practices

2010-05-09 Thread Thierry Legras
Thank you both for your answers. Are you sure using synchronized is enough inside the insert or update? I also got exceptions in call to getReadableDatabase while another thread was being writing so i don't think it would work. I am already using transaction for DB write but it did not seem to mak

Re: [android-developers] Re: SQLite & concurrent access best practices

2010-05-09 Thread Evgeny V
I believe you can provide the safe concurrency managment by using DB transactions. Since you don't care about sequence between separate activities you can run following snippet: try db.BeginTransaction db.RunCommand(insert or update etc.) db.CommitTransaction catch db.RollbackTransaction Evgeny

[android-developers] Re: SQLite & concurrent access best practices

2010-05-08 Thread Senthil ACS
For insert() and update(), have it under synchronized blocks. On May 8, 5:40 pm, Thierry Legras wrote: > Hi, > > I have an application with several tables, each being updated by AsyncTask > fired by different Activities and used by UI with SimpleCursorAdapter. > Though i am not developping a game