Package org.hibernate.engine.spi

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


        throw new LazyInitializationException( "could not initialize proxy - no Session" );
      }
      try {
        SessionFactoryImplementor sf = (SessionFactoryImplementor)
            SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
        SessionImplementor session = (SessionImplementor) sf.openSession();
       
        // TODO: On the next major release, add an
        // 'isJTA' or 'getTransactionFactory' method to Session.
        boolean isJTA = session.getTransactionCoordinator()
            .getTransactionContext().getTransactionEnvironment()
View Full Code Here


      throwLazyInitializationException( "SessionFactory UUID not known to create temporary Session for loading" );
    }

    final SessionFactoryImplementor sf = (SessionFactoryImplementor)
        SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
    return (SessionImplementor) sf.openSession();
  }

  protected Boolean readIndexExistence(final Object index) {
    if ( !initialized ) {
      final Boolean extraLazyExistenceCheck = withTemporarySessionIfNeeded(
View Full Code Here

      throwLazyInitializationException( "SessionFactory UUID not known to create temporary Session for loading" );
    }

    SessionFactoryImplementor sf = (SessionFactoryImplementor)
        SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
    return (SessionImplementor) sf.openSession();
  }

  protected Boolean readIndexExistence(final Object index) {
    if ( !initialized ) {
      Boolean extraLazyExistenceCheck = withTemporarySessionIfNeeded(
View Full Code Here

        throw new LazyInitializationException( "could not initialize proxy - no Session" );
      }
      try {
        SessionFactoryImplementor sf = (SessionFactoryImplementor)
            SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
        SessionImplementor session = (SessionImplementor) sf.openSession();
       
        // TODO: On the next major release, add an
        // 'isJTA' or 'getTransactionFactory' method to Session.
        boolean isJTA = session.getTransactionCoordinator()
            .getTransactionContext().getTransactionEnvironment()
View Full Code Here

        throwLazyInitializationExceptionIfNotConnected();
      }
      try {
        SessionFactoryImplementor sf = (SessionFactoryImplementor)
            SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
        session = (SessionImplementor) sf.openSession();
        CollectionPersister collectionPersister =
            session.getFactory().getCollectionPersister( this.getRole() );
        session.getPersistenceContext()
            .addUninitializedDetachedCollection( collectionPersister, this );
View Full Code Here

        throw new LazyInitializationException( "could not initialize proxy - no Session" );
      }
      try {
        SessionFactoryImplementor sf = (SessionFactoryImplementor)
            SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
        session = (SessionImplementor) sf.openSession();

        target = session.immediateLoad( entityName, id );
        initialized = true;
        checkTargetState();
      }
View Full Code Here

      throwLazyInitializationException( "SessionFactory UUID not known to create temporary Session for loading" );
    }

    final SessionFactoryImplementor sf = (SessionFactoryImplementor)
        SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
    final SessionImplementor session = (SessionImplementor) sf.openSession();
    session.getPersistenceContext().setDefaultReadOnly( true );
    session.setFlushMode( FlushMode.MANUAL );
    return session;
  }
View Full Code Here

        throw new LazyInitializationException( "could not initialize proxy - no Session" );
      }
      try {
        SessionFactoryImplementor sf = (SessionFactoryImplementor)
            SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
        SessionImplementor session = (SessionImplementor) sf.openSession();
        session.getPersistenceContext().setDefaultReadOnly( true );
        session.setFlushMode( FlushMode.MANUAL );

        boolean isJTA = session.getTransactionCoordinator()
            .getTransactionContext().getTransactionEnvironment()
View Full Code Here

        throw new LazyInitializationException( "could not initialize proxy - no Session" );
      }
      try {
        SessionFactoryImplementor sf = (SessionFactoryImplementor)
            SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
        SessionImplementor session = (SessionImplementor) sf.openSession();
       
        // TODO: On the next major release, add an
        // 'isJTA' or 'getTransactionFactory' method to Session.
        boolean isJTA = session.getTransactionCoordinator()
            .getTransactionContext().getTransactionEnvironment()
View Full Code Here

  @Test
  public void testTransactionWithPropagationSupportsAndCurrentSession() throws Exception {
    final SessionFactoryImplementor sf = mock(SessionFactoryImplementor.class);
    final Session session = mock(Session.class);

    given(sf.openSession()).willReturn(session);
    given(session.getSessionFactory()).willReturn(sf);
    given(session.getFlushMode()).willReturn(FlushMode.MANUAL);

    LocalSessionFactoryBean lsfb = new LocalSessionFactoryBean() {
      @Override
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.