|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dasein.persist.Transaction
public class Transaction
Represents a database transaction to applications managing their
own transactions. To use this class, call getInstance()
to get a transaction and pass that transaction to all
Execution objects that need to execute in the same
transaction context.
Last modified: $Date: 2007/02/24 19:27:48 $
| Method Summary | |
|---|---|
void |
close()
Closes the transaction. |
void |
commit()
Commits the transaction to the database and closes the transaction. |
Map<String,Object> |
execute(Class<? extends Execution> cls,
Map<String,Object> args)
|
Map<String,Object> |
execute(Class<? extends Execution> cls,
Map<String,Object> args,
String dsn)
|
HashMap<String,Object> |
execute(Execution event,
Map<String,Object> args)
Deprecated. use execute(Class, Map) |
Connection |
getConnection()
Provides events with access to the connection supporting this transaction. |
static Transaction |
getInstance()
Provides a new transaction instance to manage your transaction context. |
int |
getTransactionId()
Each transaction has a number that helps identify it for debugging purposes. |
int |
hashCode()
|
static void |
report()
|
void |
rollback()
Rolls back the transaction and closes this transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Transaction getInstance()
public static void report()
public void close()
public void commit()
throws PersistenceException
PersistenceException - either you are trying
to commit to a used up transaction or a database error occurred
during the commit
public Map<String,Object> execute(Class<? extends Execution> cls,
Map<String,Object> args)
throws PersistenceException
PersistenceException
public Map<String,Object> execute(Class<? extends Execution> cls,
Map<String,Object> args,
String dsn)
throws PersistenceException
PersistenceException
public HashMap<String,Object> execute(Execution event,
Map<String,Object> args)
throws PersistenceException
execute(Class, Map)
event - the event to execute in this transaction contextargs - the values to be used by the event
PersistenceException - an error occurred
interacting with the databasepublic Connection getConnection()
public int getTransactionId()
public int hashCode()
hashCode in class Objectpublic void rollback()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||