This content has been marked as final.
Show 3 replies
-
1. Re: how to prevent multi-access
wolfc Jul 5, 2007 11:26 AM (in response to john_woo)Use the @Version annotation, see EJB 3 Persistence 9.1.17.
@Version @Column(name="OPTLOCK") protected int getVersionNum() { return versionNum; }
-
2. Re: how to prevent multi-access
john_woo Jul 8, 2007 9:40 AM (in response to john_woo)"wolfc" wrote:
Use the @Version annotation, see EJB 3 Persistence 9.1.17.@Version @Column(name="OPTLOCK") protected int getVersionNum() { return versionNum; }
Thanks for the reply. but where is the document?
further question:
what's the mechanism using @version? I meant we don't have to do it that way, ex. we can use like timestamp field, and treat that field as just regular field, before modifying a record, simply compare the timestamp values.
John -
3. Re: how to prevent multi-access
wolfc Jul 9, 2007 5:05 AM (in response to john_woo)http://jcp.org/en/jsr/detail?id=220
The mechanism is explained in EJB 3 Persistence 3.4.