2

I am running two instances of a program and they are both accessing a TAds table.

I want to reproduce a table lock for testing, but am having trouble.

I made a button that when clicked runs the code -

SomeTAdsTable.Edit;

When I click on the button on both instances of the program I am not getting any Advantage Table errors.

I am assuming it would be trying to edit the same record on both instances of the program.

Can anyone help me reproduce a table lock error with advantage?

Thanks

Johan
  • 74,508
  • 24
  • 191
  • 319
Trevor
  • 16,080
  • 9
  • 52
  • 83

1 Answers1

2

If the TAdsTable instances reference the same table, are are both positioned to the same record number and the record locking mode is set to lmPessimistic, then the second edit should result in a lock error.

However, the LockTable method might be applicable in this situation.

Mark Wilkins
  • 40,729
  • 5
  • 57
  • 110