The persistence provider implementation of InstanceStore in use is invalid. It attempted to execute a potentially lock-acquiring ...

The persistence provider implementation of InstanceStore in use is invalid. It attempted to execute a potentially lock-acquiring command while processing a non-lock-acquiring command. This exception can occur when InstancePersistenceContext.Execute or InstancePersistenceContext.BeginExecute is called with a command that returns true from InstancePersistenceCommand.AutomaticallyAcquiringLock while processing a command which returns false. Either use a persistence provider which does not do so, or override AutomaticallyAcquiringLock on one of the commands to return the correct value.