If you perform the following sequence:
create a temporary object
lock this temporary object using methods such as System writeLock:, etc.
attempt a commit, but encounter a commit failure.
abort the session
Then the lock on the temporary object remains, but is in a invalid state. The lock can't be removed, and methods to access lock status such as sessionLocks are inconsistent.
Removing the lock before aborting avoids problems. Using System removeLocksForSession allows you to clear the state.
Last updated: 10/22/15