Closed eforth closed 8 years ago
Hi @eforth we'll try to reproduce your issue and let you know how we get on. The IndexManager
class actually uses a queue internally for all database access so these should be serialised as long as you always use the same IndexManager
.
Can you tell us which version of the library you are using?
I would advise you to try using the same IndexManager
instance throughout the lifetime of your application rather than creating a new one each time. This may help with your issue.
I was using version 1.0.0 then upgraded to 1.1.0 but the issue persists. I try out your suggestion.
Your suggestion worked. Thanks!
Great glad it works for you :)
All queries to the database are sequentially done. I used a
Executors.newSingleThreadExecutor()
to ensure only one task is executed at any time however after successfully executing one task and then moving on to the next I received the following message:E/SQLiteLog: (5) database is locked
andE/SQLiteDatabase: Failed to open database /data/data/app/app_datastores/database/extensions/com.cloudant.sync.query/indexes.sqlite
Below is an example of one of the queries:
` Datastore ds = DataManager.getInstance().getPersistenceService().getDs(); ConfigService configService = DataManager.getInstance().getConfigService(); IndexManager im = new IndexManager(ds); DocumentRevision documentRevision = new DocumentRevision();
Can you give me a clue as to why after executing this query (Successfully) and then trying execute something similar that the database would complain that it is locked?