Breaking out of RecordLock...

Robert Brenstein rjb at rz.uni-potsdam.de
Wed Feb 18 09:22:12 CST 2004


>
>>  > All users have disconnect, but db still have locks?
>  > > Cannot be.
>
>
>If I execute a SQLSelect() to get a cursor, then a Cursor_SetField() to
>set the contents of a field, then a Cursor_UpdateRecord() to update the
>database, but then forget to do a Cursor_Remove(), the field in the
>table has still been updated, right? I mean *if* there was a way to
>forcibly remove a locked cursor, and I forced this cursor to be removed,
>the data I'd posted to the table would still be there, right?
>
>Ken Ray
>Sons of Thunder Software
>Email: kray at sonsothunder.com
>Web Site: http://www.sonsothunder.com/

The way I understand what you describe will indeed leave a cursor 
open until the program owning that cursor quits. But this should 
happen only in a local mode. In server mode, the server should close 
cursors when client disconnects AFAIK. I believe that this is what 
Ruslan means "cannot be". If this does happen, Ruslan has to go bug 
hunting.

The way I deal with that is that as a rule, I create and remove 
cursors within the same handler. It makes it easier to see whether 
all calls are there and I can use a scavenger script (which lists all 
Valentina calls per handler in each object) and quickly inspect if 
anything is amiss. Further, use SQLSelectRecords if you are only 
retrieving data.

Robert


More information about the Valentina mailing list