Examples of beginTransaction()


Examples of org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.beginTransaction()

            // Note if a nested unit of work this will recursively start a
            // transaction early on the parent also.
            if (isLockQuery()) {
                if ((!unitOfWork.getCommitManager().isActive()) && (!unitOfWork.wasTransactionBegunPrematurely())) {
                    unitOfWork.beginTransaction();
                    unitOfWork.setWasTransactionBegunPrematurely(true);
                }
            }
            if (unitOfWork.isNestedUnitOfWork()) {
                UnitOfWorkImpl nestedUnitOfWork = (UnitOfWorkImpl)getSession();
View Full Code Here

Examples of org.exist.storage.txn.TransactionManager.beginTransaction()

        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            assertNotNull(broker);
            transact = pool.getTransactionManager();
            assertNotNull(transact);
            transaction = transact.beginTransaction();
            assertNotNull(transaction);

            Collection root = broker.getOrCreateCollection(transaction, TestConstants.TEST_COLLECTION_URI);
        broker.saveCollection(transaction, root);
            assertNotNull(root);
View Full Code Here

Examples of org.h2.android.H2Database.beginTransaction()

                c.close();
            }
            // log("select " + count);
            db.execSQL("delete from test");
            log("delete");
            db.beginTransaction();
            for (int i = 0; i < 1000; i++) {
                db.execSQL("INSERT INTO TEST VALUES(?, 'Hello')", new Object[] { i });
            }
            db.setTransactionSuccessful();
            db.endTransaction();
View Full Code Here

Examples of org.hibernate.Session.beginTransaction()

public class ProcessInstanceDbLog {
   
    @SuppressWarnings("unchecked")
  public static List<ProcessInstanceLog> findProcessInstances() {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<ProcessInstanceLog> result = session.createQuery("from ProcessInstanceLog").list();
        session.getTransaction().commit();
        return result;
    }
View Full Code Here

Examples of org.hibernate.Session.beginTransaction()

public class HibernateDBTest extends TestCase {

  public void testReadHibernate() throws Exception {

    Session session = HibernateHelper.currentSession();
    session.beginTransaction();
    List result = session.createQuery("from Test").list();
    for (int i = 0; i < result.size(); i++) {
      Test tst = (Test) result.get(i);
      System.out.println(tst.getFirstname() + " " + tst.getName());
    }
View Full Code Here

Examples of org.hibernate.Session.beginTransaction()

  }

  public void testUpdateHibernate() throws Exception {

    Session session = HibernateHelper.currentSession();
    session.beginTransaction();
    List result = session.createQuery("from Test").list();
    for (int i = 0; i < result.size(); i++) {
      Test tst = (Test) result.get(i);
      tst.setZip(new Integer((int) System.currentTimeMillis()));
    }
View Full Code Here

Examples of org.hibernate.Session.beginTransaction()

  public void testWriteHibernate() throws Exception {

    Session session = HibernateHelper.currentSession();

    Transaction tx = session.beginTransaction();

    Test princess = new Test();
    princess.setName("Princess");
    princess.setFirstname("Fiona");
    princess.setId(new Integer(11));
View Full Code Here

Examples of org.hibernate.Session.beginTransaction()

    CategoryIF catA = builder.createCategory(null, "News Category");
    Long catId = null;
   
    Transaction tx = null;
    try {
      tx = session.beginTransaction();
      session.save(catA);
      tx.commit();
      catId = new Long(catA.getId());
      System.out.println("Saved category with id " + catId + " persistently");
    }
View Full Code Here

Examples of org.hibernate.Session.beginTransaction()

    }
   
    // --- update
    session = handler.getSession();
    try {
      tx = session.beginTransaction();
      Category theCat = (Category) session.load(Category.class, catId);
      theCat.setTitle("Another category title");
      tx.commit();
      System.out.println("Updated category title for id: " + catId);
    } catch (HibernateException he) {
View Full Code Here

Examples of org.hibernate.Session.beginTransaction()

    }
   
    // --- list
    session = handler.getSession();
    try {
      tx = session.beginTransaction();
      // Query q = session.createQuery("select cat.id from Category as cat");
      // List result = q.list();
      Query q = session.createQuery("from Category as cat where cat.title = :title");
      q.setParameter("title", "Another category title", Hibernate.STRING);
      List cats = q.list();
View Full Code Here
TOP
Copyright © 2015 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.