Package org.jrest4guice.persistence.hibernate

Examples of org.jrest4guice.persistence.hibernate.SessionFactoryHolder


  @Override
  public Object invoke(MethodInvocation methodInvocation) throws Throwable {
    log.debug("[HibernateLocalTransactionInterceptor]进入=》"+methodInvocation.getMethod().getName());

    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);
View Full Code Here


        EntityManagerFactoryHolder emfH = GuiceContext.getInstance().getBean(EntityManagerFactoryHolder.class);
        EntityManagerInfo entityManager = emfH.getEntityManagerInfo();
        jpaTS = entityManager.getEntityManager().getTransaction();
        need2ProcessTransaction = entityManager.isNeed2ProcessTransaction();
      }else if(PersistenceGuiceContext.getInstance().isUseHibernate()){
        SessionFactoryHolder sessionFH = GuiceContext.getInstance().getBean(SessionFactoryHolder.class);
        SessionInfo session = sessionFH.getSessionInfo();
        hbTS = session.getSession().getTransaction();
        need2ProcessTransaction = session.isNeed2ProcessTransaction() && !hbTS.wasCommitted();
      }

      if(need2ProcessTransaction){
View Full Code Here

TOP

Related Classes of org.jrest4guice.persistence.hibernate.SessionFactoryHolder

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.