Package com.avaje.ebean

Examples of com.avaje.ebean.Transaction.commit()


      // transaction.setLogLevel(LogLevel.SUMMARY);
      // transaction.setBatchGetGeneratedKeys(false);

      Ebean.save(masters);

      transaction.commit();

    } finally {
      Ebean.endTransaction();
    }
  }
View Full Code Here


        item.setDescription("Another Fancy Car - Customer 2");
        item.setRegion(500);
        item.setType(10);
        getServer().save(item);

        tx.commit();
    }

    public void testFind()
    {
        List<Item> items = getServer().find(Item.class).findList();
View Full Code Here

      List<Contact> contacts = customer.getContacts();

      Assert.assertNotNull(contacts);
      Assert.assertTrue("contacts not lazily fetched", contacts.size() > 0);
    } finally {
      tx.commit();
    }
  }

  public void testRaceCondition_Simple() throws Throwable {
    ResetBasicData.reset();
View Full Code Here

        int updated = pstm.executeUpdate();
        pstm.close();

        assertEquals(1, updated);

        tx.commit();

        assertNull(lastPce);
        assertEquals(0, nuofEvents);

        getServer().refresh(al);
View Full Code Here

        // For JDBC batching we won't get the id until after
        // the batch has been flushed explicitly or via commit
        //assertNotNull(al.getId());

        tx.commit();
       
        assertNotNull(al.getId());

    }
View Full Code Here

      for (int i = 0; i < 10000; i++) {
        EBasic dumbModel = new EBasic();
        dumbModel.setName("Hello");
        server.save(dumbModel);
      }
      transaction.commit();

    } finally {
      transaction.end();
    }   
View Full Code Here

        SqlUpdate u = server.createSqlUpdate("update e_basicver set last_update = last_update+1 where id = ?");
        u.setParameter(1, v.getId());
        int count = server.execute(u, t);
        Assert.assertEquals(1, count);
       
        t.commit();
       
        v.setName("some change");
        try {
            Ebean.save(v);
            // never get here
View Full Code Here

      for (int i = 0; i < 87; i++) {
        EBasic dumbModel = new EBasic();
        dumbModel.setName("HelloB0Bi");
        server.save(dumbModel);
      }
      transaction.commit();

    } finally {
      transaction.end();
    }   
   
View Full Code Here

    try {
      txn.setBatchMode(true);
      ebeanServer.save(detail1);
      ebeanServer.save(detail2);
      ebeanServer.save(detail3);
      txn.commit();
     
    } finally {
      txn.end();
    }
   
View Full Code Here

      runStatements(expectErrors, statements, connection);

      logger.info("Running DDL Complete");

      t.commit();

    } catch (Exception e) {
      String msg = "Error: " + e.getMessage();
      throw new PersistenceException(msg, e);
    } finally {
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.