| java.lang.Object org.gomba.Transaction
Transaction | class Transaction (Code) | | Represents a JDBC transaction spanned across multiple HTTP requests.
We didn't use HttpSession because we were not happy with the standard
unRESTful session tracking mechanisms (cookies, url rewriting). A positive
side-effect is having strongly typed transaction data (instead of session
"attributes").
author: Flavio Tordini version: $Id: Transaction.java,v 1.4 2005/12/07 11:19:16 flaviotordini Exp $ |
Method Summary | |
final public void | commit() Commit this transaction. | final protected void | finalize() | protected synchronized Connection | getConnection() Returns the connection. | public Date | getCreationTime() Returns the time when this transaction was created. | public long | getLastAccessedTime() Returns the last time the client sent a request associated with this
transaction, as the number of milliseconds since midnight January 1, 1970
GMT, and marked by the time the container received the request. | public int | getMaxInactiveInterval() Returns the maximum time interval, in seconds, that this transaction will
be kept open between client accesses. | public String | getUri() Returns a string containing the URI assigned to this transaction. | public boolean | isExpired() | final public void | rollback() Rollback this transaction. |
Transaction | protected Transaction(ServletLogger logger, DataSource dataSource, String uri, int maxInactiveInterval)(Code) | | Constructor.
Parameters: logger - Our custom logger. Parameters: dataSource - A JDBC DataSource Parameters: uri - A URI that uniquely identifies this transaction. Parameters: maxInactiveInterval - The maximum number of seconds for this transaction to remainactive |
getConnection | protected synchronized Connection getConnection() throws SQLException(Code) | | Returns the connection. Do not close this connection, it will beclosed by commit() or rollback(). |
getCreationTime | public Date getCreationTime()(Code) | | Returns the time when this transaction was created.
a java.util.Date specifying when this transactionwas created. |
getLastAccessedTime | public long getLastAccessedTime()(Code) | | Returns the last time the client sent a request associated with this
transaction, as the number of milliseconds since midnight January 1, 1970
GMT, and marked by the time the container received the request.
a long representing the last time the client sent a requestassociated with this transaction, expressed in milliseconds since1/1/1970 GMT |
getMaxInactiveInterval | public int getMaxInactiveInterval()(Code) | | Returns the maximum time interval, in seconds, that this transaction will
be kept open between client accesses. After this interval, the
transaction will be invalidated.
an integer specifying the number of seconds this transactionremains open between client requests. It is always greater thanzero. |
getUri | public String getUri()(Code) | | Returns a string containing the URI assigned to this transaction.
a string specifying the URI assigned to this transaction |
isExpired | public boolean isExpired()(Code) | | true if the transaction has expired. |
|
|