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

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

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

    七段

    無論怎樣,請讓我先感謝一下國家。

    BlogJava 首頁 新隨筆 聯系 聚合 管理
      35 Posts :: 2 Stories :: 7 Comments :: 0 Trackbacks

    1 definition:

    “A transaction is a complete unit of work. It may comprise many computational tasks,which may include user interface, data retrieval, and communications. A typicaltransaction modifies shared resources.”

    2 transaction features:
    ACID (atomicity, consistency, isolation, durability)

    3 java spec
    JTA, JTS
     1interface javax.transaction.TransactionManager
     2{
     3public abstract void begin();
     4public abstract void commit();
     5public abstract int getStatus();
     6public abstract Transaction getTransaction();
     7public void resume(Transaction tobj);
     8public abstract void rollback();
     9public abstract void setRollbackOnly();
    10public abstract void setTransactionTimeout(intseconds);
    11public abstract Transaction suspend() ;
    12}

    4 Common XAResource
    JDBC 2.0:
    A JDBC driver that supports distributed transactions implements the javax.transaction.xa.XAResource interface, the javax.sql.XAConnectioninterface, and the  javax.sql.XADataSource interface.

    JMS 1.0:

    a JMS provider javax.transaction.xa.XAResource interface, the implements the javax.jms.XAConnection and the javax.jms.XASession interface.

    5 Common TransactionManager

    5.1 EJB Transaction Options:
    NotSupported
        If the method is called within a transaction, this transaction is suspended during the time of the method execution.
    Required
        If the method is called within a transaction, the method is executed in the scope of this transaction; otherwise, a new transaction is started for the execution of the method and committed before the method result is sent to the caller.
    RequiresNew
        The method will always be executed within the scope of a new transaction. The new transaction is started for the execution of the method, and committed before the method result is sent to the caller. If the method is called within a transaction, this transaction is suspended before the new one is started and resumed when the new transaction has completed.
    Mandatory
        The method should always be called within the scope of a transaction, else the container will throw the TransactionRequired exception.
    Supports
        The method is invoked within the caller transaction scope; if the caller does not have an associated transaction, the method is invoked without a transaction scope.
    Never
        The client is required to call the bean without any transaction context; if it is not the case, a java.rmi.RemoteException is thrown by the container.

    5.2 Spring transaction:
          Transaction isolation: The degree of isolation this transaction has from the work of other transactions. For example, can this transaction see uncommitted writes from other transactions? avaliable options:
    ISOLATION_DEFAULT
    ISOLATION_READ_UNCOMMITTED
    ISOLATION_READ_COMMITTED
    ISOLATION_REPEATABLE_READ
    ISOLATION_SERIALIZABLE

          Transaction propagation: Normally all code executed within a transaction scope will run in that transaction. However, there are several options specifying behavior if a transactional method is executed when a transaction context already exists: For example, simply running in the existing transaction (the most common case); or suspending the existing transaction and creating a new transaction. Spring offers the transaction propagation options familiar from EJB CMT. avaliable options:
    PROPAGATION_MANDATORY
    PROPAGATION_NESTED
    PROPAGATION_NEVER
    PROPAGATION_NOT_SUPPORTED
    PROPAGATION_REQUIRED
    PROPAGATION_REQUIRES_NEW
    PROPAGATION_SUPPORTS

          Transaction timeout: How long this transaction may run before timing out (automatically being rolled back by the underlying transaction infrastructure).
          Read-only status: A read-only transaction does not modify any data. Read-only transactions can be a useful optimization in some cases (such as when using Hibernate).


    6 transaction for web service
    Protocol specifications:
    WS-Transaction
    OASIS Business Transaction Protocol (BTP)
    Java API
    JAXTX (JSR-156)

     

    posted on 2010-04-25 16:44 sevenduan 閱讀(617) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 久操免费在线观看| 国产免费久久精品99久久| 亚洲影视自拍揄拍愉拍| 亚洲w码欧洲s码免费| 永久免费av无码网站大全| 亚洲人成图片小说网站| 亚洲高清日韩精品第一区| 久久免费国产视频| 亚洲五月六月丁香激情| 最近中文字幕免费完整| 亚洲欧洲日产国码一级毛片| 一级a性色生活片久久无少妇一级婬片免费放| 免费无码不卡视频在线观看| 午夜亚洲WWW湿好爽| 国产精品视频白浆免费视频| 91在线精品亚洲一区二区| 最近2022中文字幕免费视频| 亚洲一区二区三区久久| a级在线观看免费| 亚洲日本一区二区三区| 日日麻批免费40分钟日本的| 亚洲人成网站色在线观看| 午夜精品射精入后重之免费观看| 亚洲精品网站在线观看不卡无广告| 国产美女视频免费观看的网站 | 久久99九九国产免费看小说| 456亚洲人成影院在线观| 暖暖免费高清日本一区二区三区| 免费人成视频在线观看免费| 国产成人A亚洲精V品无码| 自拍偷自拍亚洲精品偷一| 在线亚洲精品自拍| 久久精品免费一区二区| 亚洲老熟女五十路老熟女bbw| 中文字幕影片免费在线观看 | 毛片a级毛片免费观看免下载| 国产一区二区三区亚洲综合| 成年女人免费v片| 福利免费在线观看| MM131亚洲国产美女久久| 很黄很黄的网站免费的|