org.ephman.abra.database
Interface DatabaseSession

All Known Implementing Classes:
JDBCDatabaseSession

public interface DatabaseSession

DatabaseSession represents a connection to a database. One of these objects is needed for a thread that needs to talk to a database.


Method Summary
 void commitTransaction()
          Commit the current transaction.
 void disconnect()
          Disconnect the session from the database
 Identified getItem(GenericFactoryBase fac, int oid)
          retrieves object from transacted cache
 boolean inTransaction()
          Returns true if we are in a transaction.
 boolean isLockingMode()
          Returns true if we are locking objects to perform an update..
 void putItem(GenericFactoryBase fac, Identified item)
          Stores object in transacted cache
 void rollbackTransaction()
          Rollsback the current transaction.
 void startTransaction()
          Starts a transaction.
 

Method Detail

startTransaction

public void startTransaction()
                      throws java.sql.SQLException
Starts a transaction. "inTransaction" must be false before this call

java.sql.SQLException

commitTransaction

public void commitTransaction()
                       throws java.sql.SQLException
Commit the current transaction. "inTransaction" must be true before this call

java.sql.SQLException

rollbackTransaction

public void rollbackTransaction()
                         throws java.sql.SQLException
Rollsback the current transaction. "inTransaction" must be true before this call

java.sql.SQLException

inTransaction

public boolean inTransaction()
Returns true if we are in a transaction. It will be set true when "startTransaction" is called and it will become false when commit or rollback are called.


isLockingMode

public boolean isLockingMode()
Returns true if we are locking objects to perform an update..


putItem

public void putItem(GenericFactoryBase fac,
                    Identified item)
Stores object in transacted cache


getItem

public Identified getItem(GenericFactoryBase fac,
                          int oid)
retrieves object from transacted cache


disconnect

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

java.sql.SQLException