cancel
Showing results for 
Search instead for 
Did you mean: 

XE7 / XE8 + Firedac + Pessimistic locking

Former Member
0 Kudos

Hi,

is there any chance to get that pessimistic locking working with firedac? If not has someone created a way of locking mechanism to lock i.e. the current edited dataset-row so other users can't edit same record at the same time with firedac and ads?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I will preface this by saying I've never used Firedac.  This may be a better question to ask of the FireDac community.

Reading through the Embarcadero help file, it looks like everything in FireDac is done via SQL.  (it even appears that TFDTable converts the tablename into a simple SELECT statement)

There is not a way to really get Pessimistic locking with ADS and SQL.

One possible option is to begin a transaction, update the record (i.e. add a field "locked")
Select the record for the user to Edit

Issue another update once the user is done editing

Finally Commit the Transaction.

While the Transaction is open and once the record is first updated it will be locked until commited.