com.subshell.persistence.database
Interface Database

All Known Implementing Classes:
HibernateDatabase

public interface Database

A database. Database instances can be obtained using DatabaseFactory.getDatabase(). See the package description on how to work with Databases.

Note: Implementors must be thread-safe!


Method Summary
 void close()
          Closes this Database.
 boolean isClosed()
          Returns whether this Database has been closed.
 Transaction openTransaction()
          Opens and returns a new Transaction.
 

Method Detail

close

void close()
           throws PersistenceException
Closes this Database. The Database cannot be reused once it has been closed.

Throws:
PersistenceException - when the closing fails
DatabaseClosedException - when this Database has been closed already

openTransaction

Transaction openTransaction()
                            throws PersistenceException
Opens and returns a new Transaction.

Returns:
the new transaction
Throws:
PersistenceException - when opening the transaction fails
DatabaseClosedException - when this Database has been closed already

isClosed

boolean isClosed()
                 throws PersistenceException
Returns whether this Database has been closed.

Returns:
true, when this database has been closed, else false
Throws:
PersistenceException - when there is a persistence-related error


Copyright © 2004-2005 subshell GmbH. All Rights Reserved.