Open
Description
Hi there,
We are using sqlite-plugin to handle db operations in ionic app side. We have our own plugin that needs to interact with database as well. Its has been observed that sometimes we get 'db locked' errors. On root causing the issue, the obvious suspect was indeed the culprit! In our plugin, for every execution we open the db and when plugin exits close the db.
init() {
self.db = self.open()
}
deinit {
if sqlite3_close(db) != SQLITE_OK {
print("error while closing database")
} else{
print("successfully closed database")
}
}
Since our plugin gets executed multiple time in quick succession, results in multiple db objects live on the fly.
Hence I was wondering, if we can somehow re-use the same database object that sqlite-plugin uses. This will be a robust solution as well. Is it possible?
Thanks so much,
Richeek