Package org.hibernate

Examples of org.hibernate.Session.disconnect()


      if (hsl != null) {
        session = hsl.getSession();
        // gibt es eine Hibernate-Session und ist diese mit der DB verbunden,
        // dann wird diese jetzt getrennt
        if (session != null && session.isConnected()) {
          session.disconnect();
        }
      }
    }
  }
View Full Code Here


    Session session = getSession();
    try {
      threadSession.set(null);
      if (session.isConnected() && session.isOpen()) {
        session.disconnect();
      }
    } catch (HibernateException ex) {
      throw new InfrastructureException(ex);
    }
    return session;
View Full Code Here

    prepare();
    Session sessionUnderTest = getSessionUnderTest();

    sessionUnderTest.enableFilter( "nameIsNull" );
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );
    sessionUnderTest.disconnect();
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );

    byte[] bytes = SerializationHelper.serialize( sessionUnderTest );
    checkSerializedState( sessionUnderTest );
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );
View Full Code Here

    byte[] bytes = SerializationHelper.serialize( sessionUnderTest );
    checkSerializedState( sessionUnderTest );
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );
    reconnect( sessionUnderTest );
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );
    sessionUnderTest.disconnect();
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );

    Session s2 = ( Session ) SerializationHelper.deserialize( bytes );
    checkDeserializedState( s2 );
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );
View Full Code Here

    checkDeserializedState( s2 );
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );
    reconnect( s2 );
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );

    s2.disconnect();
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );
    reconnect( s2 );
    assertNotNull( sessionUnderTest.getEnabledFilter( "nameIsNull" ) );

    release( sessionUnderTest );
View Full Code Here

   */
  public final void testManualDisconnectedSerialization() throws Throwable {
    prepare();
    Session sessionUnderTest = getSessionUnderTest();

    sessionUnderTest.disconnect();

    SerializationHelper.serialize( sessionUnderTest );
    checkSerializedState( sessionUnderTest );

    release( sessionUnderTest );
View Full Code Here

   */
  public final void testManualDisconnectChain() throws Throwable {
    prepare();
    Session sessionUnderTest = getSessionUnderTest();

    sessionUnderTest.disconnect();

    byte[] bytes = SerializationHelper.serialize( sessionUnderTest );
    checkSerializedState( sessionUnderTest );
    Session s2 = ( Session ) SerializationHelper.deserialize( bytes );
    checkDeserializedState( s2 );
View Full Code Here

    Session s2 = ( Session ) SerializationHelper.deserialize( bytes );
    checkDeserializedState( s2 );

    reconnect( s2 );

    s2.disconnect();
    reconnect( s2 );

    release( sessionUnderTest );
    release( s2 );
    done();
View Full Code Here

    sessionUnderTest.save( silly );
    sessionUnderTest.flush();

    sessionUnderTest.createQuery( "from Silly" ).iterate();

    sessionUnderTest.disconnect();
    SerializationHelper.serialize( sessionUnderTest );
    checkSerializedState( sessionUnderTest );

    reconnect( sessionUnderTest );
    sessionUnderTest.createQuery( "from Silly" ).scroll();
View Full Code Here

    checkSerializedState( sessionUnderTest );

    reconnect( sessionUnderTest );
    sessionUnderTest.createQuery( "from Silly" ).scroll();

    sessionUnderTest.disconnect();
    SerializationHelper.serialize( sessionUnderTest );
    checkSerializedState( sessionUnderTest );

    reconnect( sessionUnderTest );
    sessionUnderTest.delete( silly );
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.