<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    eric-1001c

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      3 隨筆 :: 45 文章 :: 12 評(píng)論 :: 0 Trackbacks
    Let me first of all state the expected behavior: Silently marking a transaction as rollback-only through a setRollbackOnly call will work as long as you do it at the *outermost* transaction level. If you do it within an inner transaction scope, the outer transaction will see this as a "global" rollback-only and throw an UnexpectedRollbackException - since the code in the outer transaction did not explicitly ask for a rollback, so needs to be notified.

    So in your scenario, I would assume that you do the setRollbackOnly within an inner transaction scope. Since you're using <tx:advice>, this could mean that your pointcut is too broad and applies transaction demarcation at multiple levels: for example, at the Controller level as well as at the service level, with the setRollbackOnly call happening in a service - this would lead to an UnexpectedRollbackException at the Controller level.

    That said, I would actually argue that you should virtually never be using a programmatic setRollbackOnly call in the first place, or more specifically, a rollback without exception thrown to the caller. This usually indicates inappropriate transaction scopes.

    In particular, web data binding should *not* happen within a transaction. Rather, perform data binding without transaction first, then start transactions at the service level *once you decided to process the bound data*, with the bound data brought into the transaction through a merge operation. This way, validation errors don't require a transaction rollback in the first place...

    Aside from avoiding programmatic setRollbackOnly calls in your application code, the above approach to validation and transactions also avoids excessive rollbacks in your transaction statistics. Such rollbacks for frequent and perfectly normal user interactions should in particular be avoided in administered environments like a J2EE server installation - with transaction monitoring and (potentially) escalation messages generated for rollbacks.
    posted on 2008-04-05 12:36 Eric-1001c 閱讀(208) 評(píng)論(0)  編輯  收藏 所屬分類: Hibernate
    主站蜘蛛池模板: 2021免费日韩视频网| 久久99热精品免费观看牛牛| 在线jlzzjlzz免费播放| 亚洲国产日产无码精品| 日本高清在线免费| 亚洲另类小说图片| 最近2019中文字幕免费看最新| 国产亚洲玖玖玖在线观看| 成人免费视频软件网站| 精品久久久久亚洲| 亚洲熟伦熟女新五十路熟妇| 国产精品免费视频观看拍拍| 91麻豆精品国产自产在线观看亚洲| 两个人看的www免费视频中文| 亚洲av无码专区国产乱码在线观看 | 青青青青青青久久久免费观看| 亚洲AV无码资源在线观看| www国产亚洲精品久久久日本| eeuss影院免费直达入口| 午夜亚洲www湿好大| 亚洲免费中文字幕| 亚洲高清乱码午夜电影网| 亚洲AV伊人久久青青草原| 国产一级在线免费观看| 亚洲国产精品久久丫| 日韩精品视频免费在线观看| 国产黄色片免费看| 亚洲男人的天堂在线| 国产成人啪精品视频免费网| 在线免费播放一级毛片 | 4444亚洲国产成人精品| 成人免费午夜视频| 久久国产乱子伦精品免费午夜| 久久亚洲精品国产精品| 国产成人综合久久精品免费| 中文无码成人免费视频在线观看| 亚洲资源最新版在线观看| 亚洲精品无码永久在线观看| 最近中文字幕完整版免费高清| 国产成人精品亚洲| 久久青青草原亚洲av无码app|