I am working on an Application where i have to use multi threading. I have a single instance of SQLiteOpenHelper class throughout my application where i have methods to open and close database and some methods to insert and fetch data.
Now my problem is, I open database in First Thread and start transactions at the same time Second Thread also get the opened database object and start transactions.
The First thread complete its process and close the database on the other side my Second thread is working and the Second Thread gets that the database is closed.
Its some logical issue please someone help me to solve this problem how i can handle the closing the database in a proper way.
Thanks in advance