Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.persistence.db
Class DbTransaction
All Implemented Interfaces:
       Transaction

public class DbTransaction      
Implements the transaction interface in terms of a database transaction The
DbTransaction also abstracts the concept of database connection by providing
a wrapper for the Connection object
Implements:
Transaction
 
Links:
Implementation Implementation Link
to Interface Transaction
Implements the transaction interface in terms of a database transaction The
DbTransaction also abstracts the concept of database connection by providing
a wrapper for the Connection object
 
 

Nested Class Summary
public class
QueryLock
Field Summary
QueryLock
private static String
private Connection
private int
private static Logger
private QueryLock
QueryLock
NONE
QueryLock
ROW_LEVEL_NO_WAIT
QueryLock
ROW_LEVEL_WAIT
Constructor Summary
public void
DbTransaction(Connection con, Integer isolationLevel)
public void
DbTransaction(Connection con)
public void
Method Summary
public void
public void
public void
end()
public Connection
public QueryLock
public void
public void
setConnection(Connection con)
private void
public void
setQueryLock(QueryLock queryLock)
Field Detail
className
private static String className
Multiplicity:
1
Static.
 

con
private Connection con
Multiplicity:
1
 

isolationLevel
private int isolationLevel
Multiplicity:
1
 

logger
private static Logger logger
Multiplicity:
1
Static.
 

queryLock
QueryLock queryLock
 

queryLock
private QueryLock queryLock
Multiplicity:
1
 
Constructor Detail
DbTransaction
public void DbTransaction (Connection con, Integer isolationLevel)
 
Constructor for the DbTransaction object
Parameters:
con a valid Connection object
isolationLevel the isolation level for the specified transaction
can be one of READ_UNCOMMITED, READ_COMMITED, REPEATABLE_READ, and
SERIALIZED
Stereotype:
create
 

DbTransaction
public void DbTransaction (Connection con)
 
Constructor for the DbTransaction object
Parameters:
con a valid Connection object
Stereotype:
create
 

DbTransaction
public void DbTransaction ()
 
Stereotype:
create
 
Method Detail
begin
public void begin ()
 
Starts the transaction by setting the isolation level on the wrapped
connection
Exceptions:
PersistenceException if an error occurs setting the isolation
level
Throws:
PersistenceException
 

commit
public void commit ()
 
Commits the console transaction by propagating the request to the wrapped
connection
Exceptions:
PersistenceException if an error occurs commiting the
transaction
Throws:
PersistenceException
 

end
public void end ()
 
Ends the transaction by closing the wrapped connection
Exceptions:
PersistenceException if an error occurs closing the transaction
Throws:
PersistenceException
 

getConnection
public Connection getConnection ()
 
Gets the connection attribute of the DbTransaction object
Return:
The connection value
 

getQueryLock
public QueryLock getQueryLock ()
 
 

rollback
public void rollback ()
 
Rolls back the transaction by propagating the request to the wrapped
Connection
Exceptions:
PersistenceException if an error occurs commiting the
transaction
Throws:
PersistenceException
 

setConnection
public void setConnection (Connection con)
 
Sets the connection attribute of the DbTransaction object
Parameters:
con The new connection value
 

setIsolationLevel
private void setIsolationLevel ()
 
Translate the console isolation level to a JDBC isolation level and assign
it to the Connection
Exceptions:
SQLException if an error occurs assigning the specified
isolation level
Throws:
SQLException
 

setQueryLock
public void setQueryLock (QueryLock queryLock)
 
 

Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD