|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinfo.fingo.db.BasePeer
public abstract class BasePeer
The base class for all peers. Encapsulates the connection and transaction management.
| Field Summary | |
|---|---|
protected javax.sql.DataSource |
dataSource
The data source for this peer. |
protected org.apache.log4j.Logger |
logger
The logger. |
| Constructor Summary | |
|---|---|
BasePeer(javax.sql.DataSource dataSource)
Creates new peer working with given data source. |
|
| Method Summary | |
|---|---|
void |
commitTransaction()
Commits current transaction. |
protected java.sql.Connection |
getConnection()
Returns the connection. |
protected void |
releaseConnection()
If there is no transaction set, releases the connection. |
void |
rollbackTransaction()
Rollbacks current transaction (if any). |
void |
setTransaction()
Starts transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.log4j.Logger logger
protected javax.sql.DataSource dataSource
| Constructor Detail |
|---|
public BasePeer(javax.sql.DataSource dataSource)
dataSource - the data source for peer to work with| Method Detail |
|---|
public void setTransaction()
throws java.sql.SQLException
java.sql.SQLException
public void rollbackTransaction()
throws java.sql.SQLException
rollbackTransaction method always releases the connection!
java.sql.SQLException
public void commitTransaction()
throws java.sql.SQLException
commitTransaction method always releases the connection!
java.sql.SQLException
protected java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void releaseConnection()
SQLException that could occur..
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||