lqxue

          常用鏈接

          統(tǒng)計(jì)

          book

          tools

          最新評(píng)論

          hibernate version

          3.4.2 Version Attributes
          The Version field or property is used by the persistence provider to perform optimistic locking. It is
          accessed and/or set by the persistence provider in the course of performing lifecycle operations on the
          entity instance. An entity is automatically enabled for optimistic locking if it has a property or field
          mapped with a Version mapping.

          An entity may access the state of its version field or property or export a method for use by the application
          to access the version, but must not modify the version value[17]. Only the persistence provider is
          permitted to set or update the value of the version attribute in the object.

          The version attribute is updated by the persistence provider runtime when the object is written to the
          database. All non-relationship fields and properties and all relationships owned by the entity are
          included in version checks.

          The persistence provider's implementation of the merge operation must examine the version attribute
          when an entity is being merged and throw an OptimisticLockException if it is discovered that
          the object being merged is a stale copy of the entity—i.e. that the entity has been updated since the
          entity became detached. Depending on the implementation strategy used, it is possible that this exception
          may not be thrown until flush is called or commit time, whichever happens first.

          The persistence provider runtime is only required to use the version attribute when performing optimistic
          lock checking. Persistence provider implementations may provide additional mechanisms beside
          version attributes to enable optimistic lock checking. However, support for such mechanisms is not
          required of an implementation of this specification.[18]

          If only some entities contain version attributes, the persistence provider runtime is required to check
          those entities for which version attributes have been specified. The consistency of the object graph is not
          guaranteed, but the absence of version attributes on some of the entities will not stop operations from
          completing.

          posted on 2007-05-14 14:17 lqx 閱讀(293) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 米脂县| 淅川县| 桐柏县| 阿鲁科尔沁旗| 无为县| 交城县| 台东县| 磴口县| 赤峰市| 镇安县| 紫金县| 上林县| 宜兴市| 柳河县| 米易县| 自治县| 汤原县| 肇东市| 叙永县| 安溪县| 丹巴县| 乾安县| 龙川县| 临潭县| 七台河市| 北碚区| 榆林市| 福安市| 宜昌市| 百色市| 雅江县| 沙坪坝区| 庄浪县| 金昌市| 平安县| 隆昌县| 郴州市| 北票市| 苏尼特左旗| 桂平市| 翁牛特旗|