03-28-2012 08:01 AM
My snippet is:
Statement mstatement = null;
URI uri = URI.create(DBPath);
sqliteDb = DatabaseFactory.openOrCreate(uri);
mStatement = sqliteDb.createStatement(strQuery);
My problem is, I am getting error as "Sqlite pendingOperation" at mstatement.prepare();.
Please tell me why I am getting this and how to remove it.
Solved! Go to Solution.
04-10-2012 11:13 AM
I don't see an issue with the code snippet above. Are you access the database concurrently in multiple threads and/or preparing the statement in multiple locations simultaneously?
04-11-2012 10:15 AM
Are you sharing statement across threads? If so that is likely the cause.
04-12-2012 03:01 AM
Yes, but please tell me any solution to solve it.
One more thing, I am using synchronized lock of global object for each block where I am opening and closing database.
04-12-2012 11:26 AM
How frequently are you opening and closing the database? Is it happening in rapid succession? It may be better to open/close once when you application starts and ends.
04-12-2012 11:48 PM
No, I think you are not right. It is not an efficient method to open or close at once only.
Because it is creating 1 journal file at the location of db file, and we are not able to access anything from database.
04-18-2012 12:25 AM
Hi, Please give me appropriate so that I can apply it to my application.
I am using synchronized blocks at each and every database handling methods. This is happening while multiple threads are running.
04-20-2012 09:21 AM
I got answer by myself.:Rockon::Rockon:
Cursor c =null;
Vector followups =newVector();
**boolean runFlag =true;**
SELECT EventId,OldTitle,OrderNumber,Status,Title,Type,UpdateDateTime,Id FROM Questions WHERE EventId=5 AND Type=1 AND (Status=0 OR Status=1 OR Status=2) ORDER BY OrderNumber
System.out.print(ERRORSTRING +"getUploadFollowupsFromDB: "
Added stared code in all methods.