EJB design: Optimistic Locking for CMPs - Another question

  1. Optimistic Locking for CMPs - Another question (1 messages)

    Hi All,

    I know there are many discussions on this topic but I haven't found any good answer to these question -

     1. Can we implement Optimistic Locking in CMPs?
     2. Is there any generic solution (instead of vendor-specific) to achieve the same?
     3. If not, how can I write a generic code to stale data condition so that a USER FRIENDLY MESSAGE is displayed back to the user?

    Does anybody have any opinion on the following approach:

      1. Adding a modified_on date field (or for that matter revision_no) as part of the primary key - This way if my modified_on date is different, NoSuchObjectException will be thrown.
    Am I missing something? Are there any other side-effect of this?

    Thanks in advance for your help.

  2. Does anybody have any views on this topic?