org.glite.security.voms.database.connection
Class Update

java.lang.Object
  extended byorg.glite.security.voms.database.connection.Transaction
      extended byorg.glite.security.voms.database.connection.ClientTransaction
          extended byorg.glite.security.voms.database.connection.Update

public final class Update
extends ClientTransaction

A subclass of Transaction for updates with convenient transaction management.

Author:
Karoly Lorentey

Field Summary
 
Fields inherited from class org.glite.security.voms.database.connection.Transaction
conn
 
Method Summary
static Update begin()
          Allocates an Update from the connection pool, and starts a transaction on it.
 void commit()
          Commit the current transaction, and release this connection.
 long getTransaction()
          Returns the transaction value.
 boolean isInTransaction(long id)
          Return true if the wrapper is still in the specified transaction.
 void registerChange(RowCache rc, Cacheable c)
           
 void rollback()
          Roll back the current transaction, and release this connection.
 java.lang.String toString()
           
 void writeTransactionTimestampIfNecessary()
          Write a new timestamp record for the last transaction if necessary.
 
Methods inherited from class org.glite.security.voms.database.connection.ClientTransaction
getClient, getClientCA, getClientDN, getClientId, setClient
 
Methods inherited from class org.glite.security.voms.database.connection.Transaction
getConnection, getStatement, getStatementCount, isReadOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

begin

public static Update begin()
                    throws VOMSException
Allocates an Update from the connection pool, and starts a transaction on it.

Returns:
the allocated Update.
Throws:
VOMSException

registerChange

public void registerChange(RowCache rc,
                           Cacheable c)

commit

public void commit()
            throws GeneralDatabaseException
Commit the current transaction, and release this connection.

Throws:
GeneralDatabaseException

rollback

public void rollback()
              throws GeneralDatabaseException
Roll back the current transaction, and release this connection.

Throws:
GeneralDatabaseException

isInTransaction

public boolean isInTransaction(long id)
Return true if the wrapper is still in the specified transaction.


getTransaction

public long getTransaction()
Returns the transaction value.


writeTransactionTimestampIfNecessary

public void writeTransactionTimestampIfNecessary()
                                          throws VOMSException
Write a new timestamp record for the last transaction if necessary. This is automatically called at the start of each new transaction.

Throws:
VOMSException

toString

public java.lang.String toString()