org.ephman.abra.database
Class JDBCDatabaseSession

java.lang.Object
  |
  +--org.ephman.abra.database.JDBCDatabaseSession
All Implemented Interfaces:
DatabaseSession

public class JDBCDatabaseSession
extends java.lang.Object
implements DatabaseSession

JDBC based database connection.


Constructor Summary
JDBCDatabaseSession(java.sql.Connection conn)
          Create a databasesession from a JDBC connection
 
Method Summary
 void commitTransaction()
          Commint current transaction
 void disconnect()
          Disconnect the session from the database
 void endLockingMode()
           
 Identified getItem(GenericFactoryBase fact, int oid)
          try to get an object by oid from a cache for it's factory..
 java.sql.Connection getJdbcConnection()
           
 boolean inTransaction()
          True if we are in a transaction
 boolean isLockingMode()
          Returns true if we are locking objects to perform an update..
 void putItem(GenericFactoryBase fact, Identified item)
          put an object by oid into a cache for it's factory..
 void rollbackTransaction()
          Rollback current transaction
 void setLockingMode()
           
 void startTransaction()
          start a new transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCDatabaseSession

public JDBCDatabaseSession(java.sql.Connection conn)
                    throws java.sql.SQLException
Create a databasesession from a JDBC connection

Method Detail

inTransaction

public boolean inTransaction()
True if we are in a transaction

Specified by:
inTransaction in interface DatabaseSession

commitTransaction

public void commitTransaction()
                       throws java.sql.SQLException
Commint current transaction

Specified by:
commitTransaction in interface DatabaseSession
java.sql.SQLException

rollbackTransaction

public void rollbackTransaction()
                         throws java.sql.SQLException
Rollback current transaction

Specified by:
rollbackTransaction in interface DatabaseSession
java.sql.SQLException

startTransaction

public void startTransaction()
                      throws java.sql.SQLException
start a new transaction.

Specified by:
startTransaction in interface DatabaseSession
java.sql.SQLException

setLockingMode

public void setLockingMode()

endLockingMode

public void endLockingMode()

isLockingMode

public boolean isLockingMode()
Description copied from interface: DatabaseSession
Returns true if we are locking objects to perform an update..

Specified by:
isLockingMode in interface DatabaseSession

getItem

public Identified getItem(GenericFactoryBase fact,
                          int oid)
try to get an object by oid from a cache for it's factory..

Specified by:
getItem in interface DatabaseSession

putItem

public void putItem(GenericFactoryBase fact,
                    Identified item)
put an object by oid into a cache for it's factory..

Specified by:
putItem in interface DatabaseSession

disconnect

public void disconnect()
                throws java.sql.SQLException
Disconnect the session from the database

Specified by:
disconnect in interface DatabaseSession
java.sql.SQLException

getJdbcConnection

public java.sql.Connection getJdbcConnection()