openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <>
Subject Presentation of concurrent/lock exception
Date Thu, 16 Jul 2009 19:19:33 GMT

I'm a long way from completing transition of my web application to OpenJPA.
My current persistence mechanism has a "last to commit, wins" approach.
Attempting to delete a record that doesn't exists appears (to the user) to
be successful.

I'm wondering how you all go about handling such exceptions? I have a
standard way of deleting things that captures a referential integrity
exception (when the item being deleted is referenced by something else) and
presents a generic "the item is in use" message. It seems easy enough to
adapt my current method to ignore OpenJPA's exception when deleting a
non-existent entity, but handling concurrent edits seems more difficult.

Suppose upon login a User entity has the "lastLogin" time saved. If an
administrator happens to be editing a user's record as the user logs in, the
administrator's save will fail. What do you recommend I do? It seems a bit
harsh to ask the administrator to refresh the page and start the edit over

While I'd like to have full support for handling these situations, I'd be ok
without this feature. Setting LockManager to none does not make the delete
exception go away. Is there a way to completely turn off such concurrent
modification checks?

Daryl Stultz
6 Degrees Software and Consulting, Inc.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message