Package marauroa.server.db

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


      System.out.println("> " + i);
      String cmd = "INSERT INTO itemlog_new (id, timedate, itemid, source, event, param1, param2, param3, param4)"
        + " SELECT id, timedate, itemid, source, event, param1, param2, param3, param4 FROM itemlog WHERE id >= " + (i * 100) + " AND id < "  + ((i+1) * 100);
      DBTransaction transaction = transactionPool.beginWork();
      transaction.execute(cmd, null);
      transactionPool.commit(transaction);
      System.out.println("< " + i);
      Thread.sleep(3000);
    }
  }
}
View Full Code Here


            transaction.execute(line, null);
          }
        } catch (SQLException e) {
          logger.error(cmd, e);
        }
        transactionPool.commit(transaction);
        cmd = new StringBuilder();
        Thread.sleep(3000);
      }

      System.out.println("< " + i);
View Full Code Here

    final CharacterDAO characterDAO = DAORegister.get().get(CharacterDAO.class);

    try {
      if (characterDAO.hasCharacter(trans, character)) {
        logger.warn("Character already exist: " + character);
        transactionPool.commit(trans);
        return new CharacterResult(Result.FAILED_PLAYER_EXISTS,
            character, template);
      }

      final Player object = Player.createZeroLevelPlayer(character, template);
View Full Code Here

     
      /*
       * Finally we add it to database.
       */
        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);
View Full Code Here

    final AccountDAO accountDAO = DAORegister.get().get(AccountDAO.class);

    try {
      if (accountDAO.hasPlayer(transaction, username)) {
        logger.warn("Account already exist: " + username);
        transactionPool.commit(transaction);
        return new AccountResult(Result.FAILED_PLAYER_EXISTS, username);
      }

      accountDAO.addPlayer(transaction, username, Hash.hash(password), email);
View Full Code Here

        return new AccountResult(Result.FAILED_PLAYER_EXISTS, username);
      }

      accountDAO.addPlayer(transaction, username, Hash.hash(password), email);

      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.