Class TransactionPool

java.lang.Object
marauroa.server.db.TransactionPool

public class TransactionPool extends Object
Connection Pool.
Author:
hendrik
  • Constructor Details

    • TransactionPool

      public TransactionPool(Properties connfiguration)
      creates a DBTransactionPool
      Parameters:
      connfiguration - configuration
  • Method Details

    • registerGlobally

      public void registerGlobally()
      registers this TransactionPool as the global one.
    • get

      public static TransactionPool get()
      gets the TransactionPool
      Returns:
      TransactionPool
    • beginWork

      public DBTransaction beginWork()
      starts a transaction and marks it as reserved
      Returns:
      DBTransaction
    • dumpOpenTransactions

      public void dumpOpenTransactions()
      dumps a list of open transactions with their threads and stacktraces to the log file.
    • commit

      public void commit(DBTransaction dbtransaction) throws SQLException
      commits this transaction and frees its reservation
      Parameters:
      dbtransaction - transaction
      Throws:
      SQLException - in case of an database error
    • rollback

      public void rollback(DBTransaction dbtransaction)
      rolls this transaction back and frees the reservation
      Parameters:
      dbtransaction - transaction
    • kickHangingTransactionsOfThisThread

      public void kickHangingTransactionsOfThisThread()
      Kicks all transactions which were started in the current thread
    • refreshAvailableTransaction

      public void refreshAvailableTransaction()
      removes transactions from the pool that are not connected to the databaes anymore
    • killTransaction

      public void killTransaction(DBTransaction dbtransaction)
      kills a transaction by rolling it back and closing it; it will be removed from the pool
      Parameters:
      dbtransaction - DBTransaction
    • verifyAllAvailableConnections

      public void verifyAllAvailableConnections()
      verifies all available transactions
    • close

      public void close()
      closes the transaction pool