Package org.hibernate

Examples of org.hibernate.Session.lock()


    s.close();

    s = openSession();
    t = s.beginTransaction();
    s.lock( p, LockMode.UPGRADE );
    s.lock( q, LockMode.UPGRADE );
    s.delete( p );
    s.delete( q );
    t.commit();
    s.close();
View Full Code Here


    TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));

    s = factory.openSession();
    s.setCacheMode( CacheMode.IGNORE );
    t = s.beginTransaction();
    s.lock(doc, LockMode.NONE);
    TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
    TestCase.assertEquals( doc.getText(), "blah blah" );
    TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
    t.commit();
    s.close();
View Full Code Here

    session.close();


    session = openSession();
    t = session.beginTransaction();
    session.lock(prod, LockMode.READ);
    prod.getParts().remove(mapKey);
    t.commit();
    session.close();

    session = openSession();
View Full Code Here

    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    s.lock( p, LockMode.UPGRADE );
    s.lock( q, LockMode.UPGRADE );
    s.delete( p );
    s.delete( q );
    t.commit();
    s.close();
View Full Code Here

    s.close();

    s = openSession();
    t = s.beginTransaction();
    s.lock( p, LockMode.UPGRADE );
    s.lock( q, LockMode.UPGRADE );
    s.delete( p );
    s.delete( q );
    t.commit();
    s.close();
View Full Code Here

    session.close();


    session = openSession();
    t = session.beginTransaction();
    session.lock(prod, LockMode.READ);
    prod.getParts().remove(mapKey);
    t.commit();
    session.close();

    session = openSession();
View Full Code Here

     
    } else if (Execution.STATE_ACTIVE_CONCURRENT.equals(execution.getState())) {
     
      // force version increment in the parent execution
      Session session = EnvironmentImpl.getFromCurrent(Session.class);
      session.lock(execution.getParent(), lockMode);

      execution.setState(Execution.STATE_INACTIVE_JOIN);
      execution.waitForSignal();

      ExecutionImpl concurrentRoot = execution.getParent();
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.