|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sormula.Transaction
public class Transaction
Simple transaction interface for Connection
. This class is not required for
any sormula programming and is only used by Database
as a convenience. Other
transaction mechanisms are compatible with sormula.
Constructor Summary | |
---|---|
Transaction(java.sql.Connection connection)
Constructs for a connection. |
Method Summary | |
---|---|
void |
begin()
Starts the transaction. |
protected void |
cleanUp()
Sets isActive() to false and restores auto commit to the original state. |
void |
commit()
Commits the transaction by invoking Connection.commit() . |
java.sql.Connection |
getConnection()
Gets the connection supplied in the constructor. |
boolean |
isActive()
Reports if transaction is ongoing. |
void |
rollback()
Aborts the transaction by invoking Connection.rollback() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Transaction(java.sql.Connection connection)
connection
- JDBC connectionMethod Detail |
---|
public java.sql.Connection getConnection()
public boolean isActive()
begin()
has been invoked but not commit()
or rollback()
public void begin() throws SormulaException
SormulaException
- if errorpublic void commit() throws SormulaException
Connection.commit()
.
SormulaException
- if errorpublic void rollback() throws SormulaException
Connection.rollback()
.
SormulaException
protected void cleanUp()
isActive()
to false and restores auto commit to the original state.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |