Skip Headers

# NoRowsModifiedSessionEvent Event Handler

Previous

Next

As part of your general error handling strategy, you should implement a `SessionEventListener` for `SessionEvent.NoRowsModifiedSessionEvent`.

TopLink raises this event when an update or delete query is executed against the database, but no rows are updated, that is, a zero row count is returned.

If optimistic locking is not enabled and you query the database and violate your VPD security configuration, no exception is thrown: the query simply returns zero rows updated.

If optimistic locking is enabled and you query the database and violate your VPD security configuration, an `OptimisticLockException` is thrown even though the root cause of the failure was a security violation, not an optimistic locking issue.

Note: You must add this session event listener to the server session from which you acquire your isolated client session. You cannot add them to the isolated client session itself. For more information, see "Configuring Session Event Listeners"