Lock Firebird table

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
testpresta
Posts: 32
Joined: Sat 07 Jun 2014 19:41

Lock Firebird table

Post by testpresta » Tue 05 Aug 2014 19:28

Hello

I want to lock a full firebird table.
if two users are trying to execute the same code, i don t want the second user to wait. I want to put an error message to this user.
How should i do with unidac ?

Thanks

testpresta
Posts: 32
Joined: Sat 07 Jun 2014 19:41

Re: Lock Firebird table

Post by testpresta » Wed 06 Aug 2014 19:23

Forget Firebird. I just want to know how lock a table with UniDac, whatever the database engine.
Thanks.

For example, it is possible to lock a table with this syntax on firebird when starting transaction:

Code: Select all

SET TRANSACTION NO WAIT RESERVING myTable FOR PROTECTED WRITE;
But i don t know how to give those options on TuniTransaction component

Thanks

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: Lock Firebird table

Post by PavloP » Tue 12 Aug 2014 09:34

Currently, UniDAC does not support transaction start with table block for Firebird. You may suggest the feature implementation at http://devart.uservoice.com/forums/1046 ... components.
Table block is specific for each Database servers, that are supported in UniDAC, that is why UniDAC does not include the single method for table block. To perform this task in UniDAC, you may use the "SELECT ... FOR UPDATE" и "SELECT ... WITH LOCK" commands. To learn more, refer to the official Firebird documentation.

Post Reply