thanks for eplay mihai

i am asking is there any function to check the database is opened or not
opened? in a single thread?

thanks 
kris

Mihai Limbasan wrote:
> 
> kriscbe wrote:
>> hi all,
>>
>> once the database file is opened   is some other function how to check
>> the
>> db file is opened or not opened?
>>
>> is there any function like "isopen()" in sqlite???
>>
>> thanks
>> kris
>>
>>   
> No, there is no such function, it's the application's responsibility to 
> track the database connections it has opened.
> I'm reproducing below part of a mail message sent to the list yesterday 
> which might clarify the situation:
> 
>  > Doug Porter wrote:
>  > > Is there a way to get a list of connections that are opened on a
>  > > particular SQLite database file?
>  > >
>  > > Our software uses SQLite to save our data and we want to warn a user
>  > > who opens a file that is already opened by another user. I tried a
>  > > homebrewed approach (keep a table of open connections manually), but
>  > > ran into a couple places where that won't work.
>  > >
>  > > Any help would be greatly appreciated!
>  > >
>  > > doug
> 
> Mihai Limbasan wrote:
>  > The database connection object is handled by the SQLite database 
> engine and stored in memory allocated by the database engine.
>  > SQLite does not use a client-server architecture but is completely 
> contained in a library that you link with your application, thus 
> SQLite's functions run within your application process and the database 
> connection objects exist on a per-process basis.
>  > Your question seems to suggest that your users might run multiple 
> instances of your application, potentially on separate machines. If that 
> holds true, there is no way to get a list of connections from SQLite 
> since those connection objects belong to separate processes potentially 
> on separate machines. You will have to use an IPC mechanism of your 
> choice to handle communication between instances of your app.
> 
> Hope this helps.
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-check-whether-the-database-file-opend-or-closed--tp19101495p19103046.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to