|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jso.transaction.JSOTransaction
Field Summary | |
static int |
DEFAULT_TIMEOUT
|
Fields inherited from interface net.sf.jso.transaction.Transaction |
STATUS_ACTIVE, STATUS_COMMITTED, STATUS_NOT_ACTIVE, STATUS_ROLLEDBACK |
Constructor Summary | |
JSOTransaction(JSOTransactionManager aManager)
Constructs the transaction. |
Method Summary | |
void |
addDeletedOID(OID oid)
Adds OIDs of objects deleted during transaction activity. |
void |
addStoredOIDs(java.util.Collection c)
Adds OIDs of objects stored during transaction activity. |
void |
begin()
Begins the transaction. |
static JSOTransaction |
cast(Transaction tx)
Makes a cast from Transaction to JSOTransaction. |
void |
commit()
Commits the transaction. |
protected void |
finalize()
Frees resources before it's garbage collected. |
java.sql.Connection |
getConnection()
Returns the connection within which the transaction is beeing executed. |
java.util.Set |
getDeletedOIDs()
Returns set of OIDs of objects deleted during transaction activity. |
int |
getStatus()
Returns transaction status. |
java.util.Set |
getStoredOIDs()
Returns set of OIDs of objects stored during transaction activity. |
java.lang.Thread |
getThread()
Returns the thread associated to this transaction. |
long |
getTimeout()
Gets transaction timeout. |
boolean |
isActive()
Indicates if the transaction is active. |
void |
lock(OID oid,
boolean exclusive)
Holds a lock for an object. |
void |
rollback()
Rolls back the transaction. |
static void |
safellyRollback(Transaction tx)
Rolls back a transaction without throwing any exceptions. |
void |
setTimeout(long milliseconds)
Sets transaction timeout. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_TIMEOUT
Constructor Detail |
public JSOTransaction(JSOTransactionManager aManager) throws StorageException
Method Detail |
public void begin() throws StorageException
begin
in interface Transaction
StorageException
public void lock(OID oid, boolean exclusive) throws StorageException
StorageException
public boolean isActive()
isActive
in interface Transaction
true
if the transaction is still active;
false
otherwise.public void commit() throws StorageException
commit
in interface Transaction
StorageException
public void rollback() throws StorageException
rollback
in interface Transaction
StorageException
public java.sql.Connection getConnection()
public java.lang.Thread getThread()
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
public void setTimeout(long milliseconds)
setTimeout
in interface Transaction
milliseconds
- Number of milliseconds for timeout. Values lesser than 1
millisecond mean no timeout should be used.public long getTimeout()
getTimeout
in interface Transaction
public static JSOTransaction cast(Transaction tx) throws StorageException
tx
- A reference to a potential JSOTransaction.
StorageException
- If tx is not a JSOTransaction.public void addStoredOIDs(java.util.Collection c)
public java.util.Set getStoredOIDs()
public void addDeletedOID(OID oid)
public java.util.Set getDeletedOIDs()
public int getStatus()
getStatus
in interface Transaction
public static void safellyRollback(Transaction tx)
tx
- The transaction to be rolled back.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |