Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Foreign Key question
Wed, Mar 17 2021 8:39 PMPermanent Link

Greg Hallam

Microcalm Solutions Inc

I have a EDB database with a table called InvoiceMaster.  It has a Foreign Key constraint on the field StoreID to another table called Stores via is PrimaryKey.  The On Update setting is No Action and the Delete setting is Restrict.  When I add a new record to the InvoiceMaster table it tries to do a lock on the Stores table for the record of the specified StoreID.  If it cannot get a lock on the Stores table record I get an error

ElevateDB Error #1005 The foreign key constraint StoreKey for the table InvoiceMaster has been violated (Cannot lock the matching primary or unique key 1 in the table Stores)

Is there anyway to shut off this check?  I realize that to be 100% certain the lock needs to be applied to stop the PrimaryKey in Stores to be changed during the InvoiceMaster append operation, but I would like to use the Delete check without changing some of the Pessimistic Locking being used in my application.

If I was to use Cached Updates in the Stores table update, would that be an alternative??  The Stores table is rarely edited but may hold a lock for a minute or two while the edit is happening.
Image