Package org.jrest4guice.transaction.annotations

Examples of org.jrest4guice.transaction.annotations.Transactional


  public Object invoke(MethodInvocation methodInvocation) throws Throwable {
    log.debug("[IbatisLocalTransactionInterceptor]进入=》"+methodInvocation.getMethod().getName());
    SqlMapClientHolder sqlMapClientHolder = GuiceContext.getInstance().getBean(SqlMapClientHolder.class);
   
    Method method = methodInvocation.getMethod();
    Transactional transactional = method.getAnnotation(Transactional.class);
    if(transactional == null){
      transactional = method.getDeclaringClass().getAnnotation(Transactional.class);
    }
   
    TransactionalType type = transactional.type();
   
    IbatisTransaction transaction = sqlMapClientHolder.getIbatisTransaction();
   
    if(transaction.isActive()){
      return methodInvocation.proceed();
View Full Code Here


    SessionFactoryHolder sessionFH = GuiceContext.getInstance().getBean(SessionFactoryHolder.class);
    SessionInfo session = sessionFH.getSessionInfo();
   
    Method method = methodInvocation.getMethod();
    Transactional transactional = method.getAnnotation(Transactional.class);
    if(transactional == null){
      transactional = method.getDeclaringClass().getAnnotation(Transactional.class);
    }

    TransactionalType type = transactional.type();
   
    final Transaction transaction = session.getSession().getTransaction();

    if(type != TransactionalType.READOLNY){
      session.setNeed2ProcessTransaction(true);
View Full Code Here

    EntityManagerFactoryHolder emfH = GuiceContext.getInstance().getBean(EntityManagerFactoryHolder.class);
    EntityManagerInfo entityManager = emfH.getEntityManagerInfo();
   
    Method method = methodInvocation.getMethod();
    Transactional transactional = method.getAnnotation(Transactional.class);
    if(transactional == null){
      transactional = method.getDeclaringClass().getAnnotation(Transactional.class);
    }
   
    TransactionalType type = transactional.type();
    if(type != TransactionalType.READOLNY){
      entityManager.setNeed2ProcessTransaction(true);
    }
   
    final EntityTransaction transaction = entityManager.getEntityManager().getTransaction();
View Full Code Here

TOP

Related Classes of org.jrest4guice.transaction.annotations.Transactional

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.