localtransaction.java

来自「在ArcGIS中应用EJB的实例」· Java 代码 · 共 49 行

JAVA
49
字号
package com.esri.arcgis.samples.ejb;

/**
 * The LocalTransaction implementation. The LocalTransaction
 * class defines a management contract. A LocalTransaction means that the transaction
 * is local to the resource manager. No external transaction managers are involved.
 */


public class LocalTransaction implements javax.resource.spi.LocalTransaction {
  
  /**
   * Constructs an instance of the LocalTransaction object.
   */
    
  public LocalTransaction() {
  }
  
  /**
   * The application server calls the begin method to explicitly start a local transaction.
   * @throws javax.resource.ResourceException
   */

  public void begin() throws javax.resource.ResourceException {
      System.out.println("Local Transaction Begin");
  }
  
  /**
   * When the work of the transaction completes the application server commits the transactional changes made to the EIS.
   * Both the commit and rollback methods end the current transaction.
   * @throws javax.resource.ResourceException
   */

  public void commit() throws javax.resource.ResourceException {
      System.out.println("Local Transaction Commited");
  }
  
  /**
   * The rollback method rolls back the EIS to the state it was in prior to the start of the transaction.
   * Both the commit and rollback methods end the current transaction.
   * @throws javax.resource.ResourceException
   */

  public void rollback() throws javax.resource.ResourceException {
      System.out.println("Local Transaction Rolled back");
  }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?