Gene,

The quoted article said:

  "Note that the reading and updating of the version field occurs within a transaction,
  thus ensuring an exclusive lock on the customer object; otherwise, some other user
  could update the version in between the version number's read and write to the
  database. This is done by demarking the setCustomerStateHolder() method with the
  required transaction attribute, as seen in EJB-Jar file."

Unfortunately, there is no guarantee that the app. server will obtain an
exclusive lock unless you use proprietary deployment descriptor settings.

I would say the pattern is good, and is a nice complement to app. server
controlled optimistic updates.

Gene Chuang wrote:
>
> Just read this article on javaworld:
>
> http://www.javaworld.com/javaworld/jw-07-2001/jw-0713-optimism.html
>
> which suggests a simple Optimistic Locking pattern for entity beans that,
> according to the article, "does not depend on any particular application
> server implementation".  Is this true?  Can I adapt this pattern to WL 5.1
> and get Optimistic Locking?  Specifically, how can I tell WL 5.1 to turn off
> its pessimistic locking of entity bean instances so I can delegate the task
> to this pattern?  Seems to me only WL 6.0 and above has this flag...
>
> Gene Chuang
> Kiko.com
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
________________________________________________________________________________

Evan Ireland              Sybase EAServer Engineering        [EMAIL PROTECTED]
                            Wellington, New Zealand               +64 4 934-5856

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to