SqlExecute and valentina database locks

Vansh Singh vsingh at us.counterp.com
Fri Jan 2 12:49:40 CST 2009


Hello all,

Happy New Year 2009.

I don't know much about how Valentina locks a database while it is under
use. I have an application that is usually deployed on a network for
multiple people to have access to it within the network. There is
another 'updater' application that updates the database of the main
application. The main program and the updater program could be likely
running on 2 different computers.

I want to make sure that the application updater is stopped (and user is
displayed a message about it) when the main program is running anywhere
on the network. So that's where I begin to think about Valentina locking
the database. Right now it seems that there are no locks, I ran a test
where I ran the updater from my computer while the main app was running
at another computer at the same time. There was no problem reported and
the update went through. That is not a good thing so I want to build in
lock-aware logic in the updater program. The command used to
update/insert/delete record is SqlExecute. But SqlExecute only returns a
number that is the number of rows affected. What if the database is
locked and the sql passed is run unsuccessfully? Stepping a step back,
does Valentina even enforce any kind of locking mechanism? If yes, then
how would I check for it? If no, how do people address this kind of
issue with Valentina? You sure don't want to update a database on a
desktop app while it is under use.

Thanks
Vansh


More information about the Valentina mailing list