Package org.hibernate

Examples of org.hibernate.Session.disconnect()


      // (closed in beforeCompletion in case of TransactionManagerLookup).
      if (this.newSession) {
        SessionFactoryUtils.closeSessionOrRegisterDeferredClose(session, this.sessionFactory);
      }
      else if (!this.hibernateTransactionCompletion) {
        session.disconnect();
      }
    }
    if (!this.newSession && status != STATUS_COMMITTED) {
      // Clear all pending inserts/updates/deletes in the Session.
      // Necessary for pre-bound Sessions, to avoid inconsistent state.
View Full Code Here


      }
      if (txObject.getSessionHolder().getPreviousFlushMode() != null) {
        session.setFlushMode(txObject.getSessionHolder().getPreviousFlushMode());
      }
      if (!this.hibernateManagedSession) {
        session.disconnect();
      }
    }
    txObject.getSessionHolder().clear();
  }
View Full Code Here

    SimpleJtaTransactionManagerImpl.getInstance().begin();
    Session s = getSessions().getCurrentSession();

    s.createQuery( "from Item" ).list();

    s.disconnect();
    byte[] bytes = SerializationHelper.serialize( s );
    s = ( Session ) SerializationHelper.deserialize( bytes );
    s.reconnect();

    s.createQuery( "from Item" ).list();
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.