Trying to understand the behavior of softlocking, I thought once a transaction acquires a lock on a state via
, any other transactions trying to consume the same state will be blocked until the lock is released, much like the usual RDBMS.
But our tests show that the competing transactions get the StateNotAvailableException instead. Is that by design? Of course, if we don’t use soft locking in this case, the Notary will throw the exception for double spend.
So it seems that with and without softlocking, the end result is similar - both result in exceptions. The difference may be in performance as per the doc https://docs.corda.net/soft-locking.html?highlight=softlock.
As for the user (RPC client), what is the best practice? try/catch and rerun the flow?