Package org.hibernate.classic

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


    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 = openSession();
     s.setFlushMode(FlushMode.MANUAL);
    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

      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

    simple.setName("My UnflushedSessionSerialization Simple");
    simple.setPay( new Float(5000) );
    s.save( simple, new Long(10) );

    // Now, try to serialize session without flushing...
    s.disconnect();
    Session s2 = spoofSerialization(s);
    s.close();
    s = s2;
    s.reconnect();
View Full Code Here

     s = openSession();
     s.setFlushMode(FlushMode.MANUAL);
    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

    simple.setName("My UnflushedSessionSerialization Simple");
    simple.setPay( new Float(5000) );
    s.save( simple, new Long(10) );

    // Now, try to serialize session without flushing...
    s.disconnect();
    Session s2 = spoofSerialization(s);
    s.close();
    s = s2;
    s.reconnect();
View Full Code Here

    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

      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

    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

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.