你这不跟没说一样吗,DataSource照样支持事务

解决方案 »

  1.   

    Q. When should I use a TxDataSource instead of a DataSource?A. If your applications or environment meet any of the following criteria, you should use a Tx Data Source instead of a Data Source:
    1.Uses the Java Transaction API (JTA) 2.Uses the EJB container in WebLogic Server to manage transactions 3.Includes multiple database updates within a single transaction 4.Accesses multiple resources, such as a database and the Java Messaging Service (JMS), during a transaction 5.Uses the same connection pool on multiple servers With an EJB architecture, it is common for multiple EJBs that are doing database work to be invoked as part of a single transaction. Without XA, the only way for this to work is if all transaction participants use the exact same database connection. WebLogic Server uses the JTS driver and a TxDataSource (with Emulate Two-Phase Commit for non-XA Driver selected) to do this behind the scenes without requiring you to explicitly pass the JDBC connection from EJB to EJB. With XA (requires an XA driver), you can use a Tx Data Source in WebLogic Server for distributed transactions with two-phase commit so that EJBs can use a different database connections for each part of the transaction. In either case (with or without XA), you should use a Tx Data Source.
      

  2.   

    TxDataSource支持分布式事务比如你从一个银行把钱转入另一个银行