:) i don't want to close the connection because i need a connection for each
thread that operates with the db e.g if i have 5 threads i will need 5 open
connections. But after all it seems that android is synchronizing the
connection using global locks so i can use one connection in all threads -
Im i right ?

On Thu, Jan 28, 2010 at 6:05 PM, jotobjects <[email protected]> wrote:

> As the error message says, you have to call close().  Good practice is
> to wrap your use of the writable database in a try/catch block and
> call close in the finally block so that close never gets skipped for
> any reason.
>
> On Jan 28, 2:43 am, manigault <[email protected]> wrote:
> > Hi all, i need to use the SqliteDataBase from from multiple threads.
> > According the the sqlite documentation sqlite is threadsafe if it's
> > compiled with SQLITE_THREADSAFE = 1 and in android this can be done by
> > calling SQLiteDatabase.setLockingEnabled(true) ( the default value is
> > also true so it works even if you don't call it). So i need different
> > sqlite connection for all threads that will be using the database. How
> > can i open multiple database connections with getWritableDatabase() i
> > got Exception -  Leak found ... SQLiteDatabase created and never
> > closed
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
When I raise my flashing sword, and my hand takes hold on judgment, I will
take vengeance upon mine enemies, and I will repay those who haze me. Oh,
Lord, raise me to Thy right hand and count me among Thy saints.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to