Subject | Releasing a locked record |
---|---|
Author | Stevio |
Post date | 2003-11-17T21:50:38Z |
I am using Delphi 5 with Firebird 1 and Interbase Express 5 components.
With my application, I use a simple locking mechanism to lock a record when
a user has it open.
Basically:
- a transaction is started,
- the record in question is opened using a TIBDataSet,
- the record is put in edit mode,
- the id value for the record is set to itself.
- the change is posted.
- the TIBDataSet is closed.
- the transaction is not committed however until the user makes their
changes to the data and clicks OK.
My problem is that the system is hanging occasionally for some reason (not
sure why), and when they CTRL ALT DEL to close it and restart it, records
are being left locked for weeks at a time. (I'm not sure how they are
eventually released - perhaps if the server is rebooted they get released
then?)
How can I manually release the lock, or override the lock, on a record when
I have no access to the original transaction?
Thanks,
Stephen
With my application, I use a simple locking mechanism to lock a record when
a user has it open.
Basically:
- a transaction is started,
- the record in question is opened using a TIBDataSet,
- the record is put in edit mode,
- the id value for the record is set to itself.
- the change is posted.
- the TIBDataSet is closed.
- the transaction is not committed however until the user makes their
changes to the data and clicks OK.
My problem is that the system is hanging occasionally for some reason (not
sure why), and when they CTRL ALT DEL to close it and restart it, records
are being left locked for weeks at a time. (I'm not sure how they are
eventually released - perhaps if the server is rebooted they get released
then?)
How can I manually release the lock, or override the lock, on a record when
I have no access to the original transaction?
Thanks,
Stephen