Package org.hibernate.engine

Examples of org.hibernate.engine.SessionFactoryImplementor.openSession()


    MockJtaTransaction transaction = new MockJtaTransaction();
    given(ut.getStatus()).willReturn(Status.STATUS_ACTIVE);
    given(tm.getTransaction()).willReturn(transaction);
    final SessionFactoryImplementor sf = mock(SessionFactoryImplementor.class);
    final Session session = mock(Session.class);
    given(sf.openSession()).willReturn(session);
    given(sf.getTransactionManager()).willReturn(tm);
    given(session.isOpen()).willReturn(true);
    given(session.getFlushMode()).willReturn(FlushMode.AUTO);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
View Full Code Here


    TransactionManager tm = mock(TransactionManager.class);
    MockJtaTransaction transaction = new MockJtaTransaction();
    final SessionFactoryImplementor sf = mock(SessionFactoryImplementor.class);
    final Session session = mock(Session.class);
    given(tm.getTransaction()).willReturn(transaction);
    given(sf.openSession()).willReturn(session);
    given(sf.getTransactionManager()).willReturn(tm);
    given(session.isOpen()).willReturn(true);
    given(session.getFlushMode()).willReturn(FlushMode.AUTO);

    for (int j = 0; j < 2; j++) {
View Full Code Here

    given(tm.getTransaction()).willReturn(null);

    OpenSessionInViewInterceptor interceptor = new OpenSessionInViewInterceptor();
    interceptor.setSessionFactory(sf);

    given(sf.openSession()).willReturn(session);
    given(sf.getTransactionManager()).willReturn(tm);
    given(sf.getTransactionManager()).willReturn(tm);
    given(session.isOpen()).willReturn(true);

    interceptor.preHandle(this.webRequest);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.