Package marauroa.server.db

Examples of marauroa.server.db.TransactionPool.rollback()


      props.put("jdbc_class", "com.mysql.jdbc.Driver");
      props.put("jdbc_user", "junittest");
      props.put("jdbc_pwd", "passwd");

      TransactionPool pool = new TransactionPool(props);
      pool.rollback(pool.beginWork());
      pool.close();
    } catch (Exception e) {
      throw new Exception("Database is not accessible. Please check \"marauroatest\" is created and that user \"junittest\" with password \"passwd\" can access it.", e);
    }
  }
View Full Code Here


        characterDAO.addCharacter(trans, username, character, object);
      transactionPool.commit(trans);

      return new CharacterResult(Result.OK_CREATED, character, object);
    } catch (final Exception e) {
      transactionPool.rollback(trans);
      logger.error("Can't create character", e);
      return new CharacterResult(Result.FAILED_EXCEPTION, character, template);
    }
  }
 
View Full Code Here

      transactionPool.commit(transaction);
      return new AccountResult(Result.OK_CREATED, username);
    } catch (final SQLException e) {
      logger.warn("SQL exception while trying to create a new account", e);
      transactionPool.rollback(transaction);
      return new AccountResult(Result.FAILED_EXCEPTION, username);
    }
  }
}
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.