Package org.hibernate.classic

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


    s.save(foo);
    s.save(foo2);
    foo2.setFoo(foo);
    s.flush();
    s.connection().commit();
    s.disconnect();
    s.reconnect();
    s.delete(foo);
    foo2.setFoo(null);
    s.flush();
    s.connection().commit();
View Full Code Here


    s.reconnect();
    s.delete(foo);
    foo2.setFoo(null);
    s.flush();
    s.connection().commit();
    s.disconnect();
    s.reconnect();
    s.delete(foo2);
    s.flush();
    s.connection().commit();
    s.close();
View Full Code Here

    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

    dcp.configure( Environment.getProperties() );
    Session s = getSessions().openSession( dcp.getConnection() );
    Transaction tx = s.beginTransaction();
    s.find("from Fo");
    tx.commit();
    Connection c = s.disconnect();
    assertTrue( c!=null );
    s.reconnect(c);
    tx = s.beginTransaction();
    s.find("from Fo");
    tx.commit();
View Full Code Here

      iter.remove();
    }

    s.flush();
    s.connection().commit();
    s.disconnect();
    SerializationHelper.deserialize( SerializationHelper.serialize(s) );
    s.close();
  }

  public void testCache() throws Exception {
View Full Code Here

     s = openSession();
     s.setFlushMode(FlushMode.NEVER);
    t = s.beginTransaction();
    Foo foo = (Foo) s.get(Foo.class, id);
    t.commit();
    s.disconnect();

    s.reconnect();
    t = s.beginTransaction();
    s.flush();
    t.commit();
View Full Code Here

    dcp.configure( Environment.getProperties() );
    Session s = getSessions().openSession( dcp.getConnection() );
    Transaction tx = s.beginTransaction();
    s.find("from Fo");
    tx.commit();
    Connection c = s.disconnect();
    assertTrue( c!=null );
    s.reconnect(c);
    tx = s.beginTransaction();
    s.find("from Fo");
    tx.commit();
View Full Code Here

    s.reconnect();
    s.delete(foo);
    foo2.setFoo(null);
    s.flush();
    s.connection().commit();
    s.disconnect();
    s.reconnect();
    s.delete(foo2);
    s.flush();
    s.connection().commit();
    s.close();
View Full Code Here

      iter.remove();
    }

    s.flush();
    s.connection().commit();
    s.disconnect();
    SerializationHelper.deserialize( SerializationHelper.serialize(s) );
    s.close();
  }

  public void testCache() throws Exception {
View Full Code Here

     s = openSession();
     s.setFlushMode(FlushMode.NEVER);
    t = s.beginTransaction();
    Foo foo = (Foo) s.get(Foo.class, id);
    t.commit();
    s.disconnect();

    s.reconnect();
    t = s.beginTransaction();
    s.flush();
    t.commit();
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.