Examples of callInTransaction()


Examples of com.j256.ormlite.misc.TransactionManager.callInTransaction()

    assertEquals(1, accountDao.create(account));

    TransactionManager transactionManager = new TransactionManager(connectionSource);
    try {
      // try something in a transaction
      transactionManager.callInTransaction(new Callable<Void>() {
        public Void call() throws Exception {
          // we do the delete
          assertEquals(1, accountDao.delete(account));
          assertNull(accountDao.queryForId(account.getId()));
          // but then (as an example) we throw an exception which rolls back the delete
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.