0 Replies Latest reply on Apr 7, 2003 11:15 AM by Misak Boulatian

    Optimistic Locking

    Misak Boulatian Newbie

      I am using xdoclet 1.2b to generate cmp 2.0 entity beans. The description of 'use-soft-locking' option of ejb.bean tag says the following: "If true, then generate a public int version attribute in the auto-generated concrete class, to form a optimistic locking mechanism. The value of version attribute is incremented in ejbStore. The default is false. Note: It's applicable to both CMP and BMP, but many containers have optimistic locking capabilities built-in, so you don't need to worry about it locking issues.". This excerpt was directly taken from xdoclet web site. I am using jboss 3.04 with tomcat 4.1.12 bundle. What I need is to find out if jboss supports built-in optimistic locking, and if does, what exception is thrown if optimistic locking is encountered. One of the scenarios I am interested is to take the transfer object and send it to the web tier for user to view. User makes changes on the web tier and sends the object back. During manual check the versions are compared to allow the update. If web version is smaller we throw transaction rolled back exception. Please let me know if it will handle this scenario.