<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 評論 :: 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) 評論(0)  編輯  收藏 所屬分類: Hibernate
    主站蜘蛛池模板: 大片免费观看92在线视频线视频| 污污视频网站免费观看| 一个人免费视频在线观看www| 国产yw855.c免费视频| 亚洲AV永久无码天堂影院| 成人毛片18女人毛片免费| 亚洲综合一区国产精品| 成人人免费夜夜视频观看| 亚洲国产成人精品无码区花野真一| 巨胸喷奶水视频www网免费| 久久久久精品国产亚洲AV无码| 成人免费毛片内射美女-百度| 亚洲一区在线免费观看| 岛国大片免费在线观看| 国产天堂亚洲国产碰碰| 亚洲人妻av伦理| a色毛片免费视频| 日韩精品亚洲人成在线观看| 午夜国产精品免费观看| 亚洲日韩精品A∨片无码加勒比| 女人让男人免费桶爽30分钟| 看Aⅴ免费毛片手机播放| 亚洲午夜爱爱香蕉片| 13小箩利洗澡无码视频网站免费| 亚洲最新视频在线观看| 天天影视色香欲综合免费| 亚洲精品精华液一区二区 | 国产裸体美女永久免费无遮挡| 国产亚洲精品成人AA片新蒲金| 亚洲视频免费在线观看| 亚洲精品在线视频观看| 四虎www免费人成| 中文字幕高清免费不卡视频| 亚洲码一区二区三区| 国产片免费在线观看| 日韩视频在线观看免费| 亚洲精品久久无码| 亚洲成色999久久网站| 国产免费资源高清小视频在线观看| 三根一起会坏掉的好痛免费三级全黄的视频在线观看 | 免费高清小黄站在线观看 |