|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.security.voms.database.connection.Transaction
org.glite.security.voms.database.connection.DirectUpdate
Database connection wrapper for read-write operations on tables without a history trace. These wrappers are usually used in autonomous nested transactions. Thus, in order to avoid nasty singlethreaded database deadlocks, connections of this type must not be used to query or update any of the traced tables and vice versa. (ADMIN and CA count as traced tables here.)
Tables for which DirectUpdate is safe include SEQUENCE, REALTIME and REQUEST.
The idiom for using a DirectUpdate is as follows:
DirectUpdate u = DirectUpdate.begin (); long transaction = u.getTransaction(); try { // Do something. u.commit (); } catch (Exception e) { // Do something } finally { if (u.isInTransaction (transaction)) { u.rollback (); } }
Field Summary |
Fields inherited from class org.glite.security.voms.database.connection.Transaction |
conn, log |
Method Summary | |
static DirectUpdate |
begin()
Allocate a new direct update connection. |
void |
commit()
Commit the current transaction, and release this connection. |
long |
getTransaction()
Return the current transaction id. |
boolean |
isInTransaction(long id)
Return true if the wrapper has the given transaction number. |
void |
rollback()
Roll back the current transaction, and release this connection. |
java.lang.String |
toString()
|
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 |
public static DirectUpdate begin() throws VOMSException
VOMSException
public long getTransaction()
public boolean isInTransaction(long id)
public void commit() throws GeneralDatabaseException
GeneralDatabaseException
public void rollback() throws GeneralDatabaseException
GeneralDatabaseException
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |