1. gzyueqian
      18529173453
      首頁 > 新聞中心 > > 正文

      J2EEJTA和數據庫的transaction研究

      更新時間: 2007-05-18 15:23:21來源: 粵嵌教育瀏覽量:795

        研究有結果了,以下是我做了一些測試得出的結論(Sybase+Weblogic+Tx Data Source):


      方法一:

        1、設置方法為Container-Tracnsaction,方法的trans-attribute為Required
        2、幾個方法調用的SP創建前先set chained on,同時SP里是可以使用Tracnsaction的
        3、此方法調用的幾個方法使用同一Connection,Connection的setAutoCommitCommit使用默認設置或設為false,
        若設為true,則拋出異常:Cannot set auto commit to "true" when in distributed transaction


      方法二:
        1、設置方法為Container-Tracnsaction,方法的trans-attribute為Required
        2、幾個方法調用的SP創建前先set chained on,同時SP里是可以使用Tracnsaction的
        3、此方法調用的幾個方法使用各自的Connection,各方法Connection的setAutoCommitCommit使用默認設置;
        若設為true,則拋出異常:Cannot set auto commit to "true" when in distributed transaction;
        若某方法設為false,同時在EJB的方法描述里把此方法的設置方法為Container-Tracnsaction,方法的trans-attribute
        為Required, 則執行到此方法時會拋出異常:SET CHAINED command not allowed within multi-statement transaction.


      方法三:
        1、設置方法為Container-Tracnsaction,方法的trans-attribute為Required
        2、同時各方法為Container-Tracnsaction,方法的trans-attribute為Required
        3、幾個方法調用的SP創建前先set chained on,同時SP里是可以使用Tracnsaction的
        4、此方法調用的幾個方法使用各自的Connection,各方法Connection的setAutoCommitCommit使用默認設置;
        若設為true,則拋出異常:Cannot set auto commit to "true" when in distributed transaction;
        若設為false,拋出異常:SET CHAINED command not allowed within multi-statement transaction.

      免費預約試聽課

      亚洲另类欧美综合久久图片区_亚洲中文字幕日产无码2020_欧美日本一区二区三区桃色视频_亚洲AⅤ天堂一区二区三区

      
      

      1. 亚洲а∨天堂手机版在线观看 | 亚洲看片在线看 | 综合在线精品视频专区 | 亚洲V国产一区二区三区 | 中文字人妖一区二区 | 亚洲欧美国产制服 |