Examples of DBTransaction


Examples of com.caucho.db.xa.DbTransaction

  private java.sql.ResultSet executeQuery(Query query,
                                          QueryContext queryContext)
    throws SQLException
  {
    DbTransaction xa = getConnectionImpl().getTransaction();
   
    queryContext.setNonLocking();
   
    SelectCursor result = query.executeCursor(queryContext, xa);
   
View Full Code Here

Examples of com.sun.sgs.service.store.db.DbTransaction

   * Use an absolute path to avoid problems on Windows.
   * -tjb@sun.com (02/16/2007)
   */
  directory = new File(specifiedDirectory).getAbsolutePath();
  txnInfoTable = getTxnInfoTable(TxnInfo.class);
  DbTransaction dbTxn = null;
  boolean done = false;
  try {
      File directoryFile = new File(specifiedDirectory).getAbsoluteFile();
            if (!directoryFile.exists()) {
                logger.log(Level.INFO, "Creating database directory : " +
                           directoryFile.getAbsolutePath());
                if (!directoryFile.mkdirs()) {
                    throw new DataStoreException("Unable to create database " +
                                                 "directory : " +
                                                 directoryFile.getName());
                }
      }
            env = wrappedProps.getClassInstanceProperty(
                    ENVIRONMENT_CLASS_PROPERTY,
                    DEFAULT_ENVIRONMENT_CLASS,
                    DbEnvironment.class,
                    new Class<?>[]{
                        String.class, Properties.class, Scheduler.class
                    },
                    directory, properties, scheduler);
      dbTxn = env.beginTransaction(Long.MAX_VALUE);
      Databases dbs = getDatabases(dbTxn);
      infoDb = dbs.info;
      classesDb = dbs.classes;
      oidsDb = dbs.oids;
      namesDb = dbs.names;
      useAllocationBlockPlaceholders =
    env.useAllocationBlockPlaceholders();
      freeObjectIds = new FreeObjectIds(useAllocationBlockPlaceholders);
      removeUnusedAllocationPlaceholders(dbTxn);
      done = true;
      dbTxn.commit();
  } catch (RuntimeException e) {
      throw handleException(
    null, Level.SEVERE, e, "DataStore initialization");
  } catch (Error e) {
      logger.logThrow(
    Level.SEVERE, e, "DataStore initialization failed");
      throw e;
  } finally {
      if (dbTxn != null && !done) {
    try {
        dbTxn.abort();
    } catch (RuntimeException e) {
        logger.logThrow(Level.FINE, e, "Exception during abort");
    }
      }
  }
View Full Code Here

Examples of marauroa.server.db.DBTransaction

     *         tries in the defined time frame.
     * @throws SQLException
     *             if there is any database problem.
     */
    public boolean isBlocked() throws SQLException {
      DBTransaction transaction = TransactionPool.get().beginWork();
      boolean res = true;
      try {
        LoginEventDAO loginEventDAO = DAORegister.get().get(LoginEventDAO.class);
        res = loginEventDAO.isAccountBlocked(transaction, username)
          || loginEventDAO.isAddressBlocked(transaction, address.getHostAddress());
View Full Code Here

Examples of marauroa.server.db.DBTransaction

     * </ul>
     * @return a string indicating the status of the account.
     * @throws SQLException
     */
    public String getStatus() throws SQLException {
      DBTransaction transaction = TransactionPool.get().beginWork();
      String res = null;
      try {
        if (DAORegister.get().get(AccountDAO.class).hasPlayer(transaction, username)) {
          res = DAORegister.get().get(AccountDAO.class).getAccountBanMessage(transaction, username);
        }
View Full Code Here

Examples of marauroa.server.db.DBTransaction

      throw new DatabaseConnectionException(e);
    }
  }
 
  private void initializeDatabaseSchema() {
    final DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      new JDBCSQLHelper(transaction).runDBScript("marauroa/server/marauroa_init.sql");
      new UpdateScript().update(transaction);
      TransactionPool.get().commit(transaction);
    } catch (SQLException e) {
View Full Code Here

Examples of marauroa.server.db.DBTransaction

   * adds an statistics sample to the database log
   *
   * @param var Variables
   */
  public void addStatisticsEvent(Variables var) {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addStatisticsEvent(transaction, var);
      TransactionPool.get().commit(transaction);
    } catch (SQLException e) {
      logger.error(e, e);
View Full Code Here

Examples of marauroa.server.db.DBTransaction

   * @param correctLogin true, if the login was successful; false otherwise
   * @throws SQLException in case of an database error
   */
  @Deprecated
  public void addLoginEvent(String username, InetAddress source, boolean correctLogin) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addLoginEvent(transaction, username, source, null, null, correctLogin);
    } finally {
      TransactionPool.get().commit(transaction);
    }
View Full Code Here

Examples of marauroa.server.db.DBTransaction

   * @param correctLogin true, if the login was successful; false otherwise
   * @throws SQLException in case of an database error
   */
  @Deprecated
  public void addLoginEvent(String username, InetAddress source, String seed, boolean correctLogin) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addLoginEvent(transaction, username, source, null, seed, correctLogin);
    } finally {
      TransactionPool.get().commit(transaction);
    }
View Full Code Here

Examples of marauroa.server.db.DBTransaction

   * @param seed seed
   * @param correctLogin true, if the login was successful; false otherwise
   * @throws SQLException in case of an database error
   */
  public void addLoginEvent(String username, InetAddress source, String service, String seed, boolean correctLogin) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addLoginEvent(transaction, username, source, service, seed, correctLogin);
    } finally {
      TransactionPool.get().commit(transaction);
    }
View Full Code Here

Examples of marauroa.server.db.DBTransaction

   * @param events number of events
   * @return list of login attempts
   * @throws SQLException in case of an database error
   */
  public List<String> getLoginEvents(String username, int events) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      List<String> res = getLoginEvents(transaction, username, events);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
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.