我正在使用Spring Framework事务注释进行事务管理,我有一个抽象类注释@Transactional,如下所示:
package org.tts.maqraa.service;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.persistence.EntityManager;
import javax.persistence.EntityNotFoundException;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;
import javax.persistence.Query;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Parts of this code have been copied from JARVANA site.
*
* @author Younis alomoush
*
*/
@Transactional(propagation=Propagation.REQUIRED)
public abstract class AbstractMaqraaService implements MaqraaService {
private Logger logger = LoggerFactory.getLogger(this.getClass());
private int defaultMaxResults = DEFAULT_MAX_RESULTS;
@PersistenceContext(type=PersistenceContextType.TRANSACTION)
private EntityManager em;
/**
* The {@link EntityManager} which is …Run Code Online (Sandbox Code Playgroud)