transactiondao.java

来自「精通EJB3源码」· Java 代码 · 共 68 行

JAVA
68
字号
package com.foshanshop.ejb3;

import com.foshanshop.ejb3.bean.Product;

public interface TransactionDAO {
	/**
	 * 产生系统异常
	 */
    public void systemException();
	/**
	 * 产生应用异常
	 */
    public void AppException() throws AppException ; 
    /**
     * 手工设置事务回滚
     */
    public void setRollback();
    /**
     * 一个事务属性为REQUIRED的方法在一个事务范围外执行
     * @param product
     */
    public void requried_notInTransaction();
    /**
     * 一个事务属性为REQUIRED的方法在一个事务范围内执行
     * @param product
     */
    public void requried_inTransaction();
    /**
     * 一个事务属性为NOT_SUPPORTED的方法在一个事务范围内执行
     * @param product
     * @return
     */
    public Product notSupported_runInTransaction(Product product);
    /**
     * 一个事务属性为MANDATORY的方法在一个事务范围内执行
     */
    public void mandatory_inTransaction();
    /**
     * 一个事务属性为MANDATORY的方法在一个事务范围外执行
     */
    public void mandatory_notInTransaction();
    /**
     * 一个事务属性为REQUIRES_NEW的方法在一个事务范围内执行
     */
    public void requirednew_inTransaction();
    /**
     * 一个事务属性为REQUIRES_NEW的方法在一个事务范围外执行
     */
    public void requirednew_notInTransaction();
    /**
     * 一个事务属性为SUPPORTS的方法在一个事务范围内执行
     */ 
    public Product support_inTransaction();
    /**
     * 一个事务属性为SUPPORTS的方法在一个事务范围外执行
     */
    public Product support_notInTransaction();
    
    /**
     * 一个事务属性为NEVER的方法在一个事务范围内执行
     */ 
    public Product never_inTransaction(int productid);
    /**
     * 一个事务属性为NEVER的方法在一个事务范围外执行
     */
    public Product never_notInTransaction(int productid);
}

⌨️ 快捷键说明

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