File Locking Status

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

File Locking Status

Denis Burke
Is it possible to tell if SQLite has a database file locked?  Not through
OS tools, but from System.Data.SQlite?  I would like my application to be
able to understand if its use of SQLite has the file locked at a given
moment.  (and yes I know other processes/apps could also lock the file).



Thanks,
Denis Burke
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: File Locking Status

Simon Slavin-3

On 8 Mar 2016, at 6:50pm, Denis Burke <[hidden email]> wrote:

> Is it possible to tell if SQLite has a database file locked? Not through
> OS tools, but from System.Data.SQlite?

Can't answer your question but these seem relevant:

<https://www.sqlite.org/c3ref/unlock_notify.html>

<https://www.sqlite.org/unlock_notify.html>

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: File Locking Status

Denis Burke
In reply to this post by Denis Burke
Thank you Simon - that is helpful.

I would still be interested if anyone can provide any further info
regarding locking as seen through System.Data.SQlite.

-Denis

------------------
On 8 Mar 2016, at 6:50pm, Denis Burke <[hidden email]> wrote: > Is it
possible to tell if SQLite has a database file locked? Not through > OS
tools, but from System.Data.SQlite?

Can't answer your question but these seem relevant: <
https://www.sqlite.org/c3ref/unlock_notify.html> <
https://www.sqlite.org/unlock_notify.html>
Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: File Locking Status

Doug Currie-2
In reply to this post by Denis Burke
> Is it possible to tell if SQLite has a database file locked?  Not through
> OS tools, but from System.Data.SQlite?


 If you can execute

    BEGIN EXCLUSIVE TRANSACTION

and get back SQLITE_OK

then there were no locks on the database.

Of course you will then need to ROLLBACK.

Note that this will only work well if you have no busy timeout or bust
handler set.

e
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: File Locking Status

LincolnBurrows
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by Denis Burke
Why you did not go through this article of the SQLite for the concepts of Locking https://www.sqlite.org/lockingv3.html 
http://www.mimec.org/node/306 Hoping it will be helpful to you