Examples of reconnect()


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

    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

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

    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

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

    Transaction tx = s.beginTransaction();
    s.createQuery( "from Fo" ).list();
    tx.commit();
    Connection c = s.disconnect();
    assertTrue( c!=null );
    s.reconnect(c);
    tx = s.beginTransaction();
    s.createQuery( "from Fo" ).list();
    tx.commit();
    assertTrue( s.close()==c );
    c.close();
View Full Code Here

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

    s.save(foo2);
    foo2.setFoo(foo);
    s.getTransaction().commit();

    s.disconnect();
    s.reconnect();

    s.beginTransaction();
    s.delete(foo);
    foo2.setFoo(null);
    s.getTransaction().commit();
View Full Code Here

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

    s.delete(foo);
    foo2.setFoo(null);
    s.getTransaction().commit();

    s.disconnect();
    s.reconnect();

    s.beginTransaction();
    s.delete(foo2);
    s.getTransaction().commit();
    s.close();
View Full Code Here

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

    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.createQuery( "select count(*) from Bar" ).iterate().next() ).longValue()==3 );
    s2.delete(baz);
    s2.delete( baz.getTopGlarchez().get( new Character('G') ) );
View Full Code Here

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

    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

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

    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

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

    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

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
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.