Package org.hibernate.classic

Examples of org.hibernate.classic.Session.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


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

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

    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();
    assertTrue( s.close()==c );
    c.close();
View Full Code Here

    s.disconnect();

    s2 = (Session) SerializationHelper.deserialize( SerializationHelper.serialize(s) );
    s.close();

    s2.reconnect();
    txn2 = s2.beginTransaction();
    baz = (Baz) s2.load(Baz.class, baz.getCode());
    assertTrue( ( (Long) s2.iterate("select count(*) from Bar").next() ).longValue()==3 );
    s2.delete(baz);
    s2.delete( baz.getTopGlarchez().get( new Character('G') ) );
View Full Code Here

    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();
    s.disconnect();
View Full Code Here

    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

    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();
    assertTrue( s.close()==c );
    c.close();
View Full Code Here

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

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

    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");
    assertTrue( s.getCurrentLockMode(b)==LockMode.NONE );
    q = s.createQuery("from Foo foo");
View Full Code Here

    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() ) );
    assertTrue( s.getCurrentLockMode(b)==LockMode.NONE );
    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.