Package org.hibernate.classic

Examples of org.hibernate.classic.Session.disconnect()


    s2.load( Qux.class, new Long(666) ); //nonexistent

    assertTrue( s2.delete("from Glarch g")==1 );
    txn2.commit();

    s2.disconnect();

    Session s3 = (Session) SerializationHelper.deserialize( SerializationHelper.serialize(s2) );
    s2.close();
    //s3.reconnect();
    assertTrue( s3.load( Qux.class, new Long(666) )!=null ); //nonexistent
View Full Code Here


    }
    Object[] result = (Object[]) q.uniqueResult();
    Object b = result[0];
    assertTrue( s.getCurrentLockMode(b)==LockMode.WRITE && s.getCurrentLockMode( result[1] )==LockMode.WRITE );
    tx.commit();
    s.disconnect();

    s.reconnect();
    tx = s.beginTransaction();
    assertTrue( s.getCurrentLockMode(b)==LockMode.NONE );
    s.find("from Foo foo");
View Full Code Here

    q.setLockMode("foo", LockMode.READ);
    q.list();
    assertTrue( s.getCurrentLockMode(b)==LockMode.READ);
    s.evict(baz);
    tx.commit();
    s.disconnect();
   
    s.reconnect();
    tx = s.beginTransaction();
    assertTrue( s.getCurrentLockMode(b)==LockMode.NONE );
    s.delete( s.load( Baz.class, baz.getCode() ) );
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.