|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.jdo.engine.AbstractDatabaseImpl
org.exolab.castor.jdo.engine.LocalDatabaseImpl
public class LocalDatabaseImpl
An implementation of the JDO Database interface supporting explicit local
transaction demarcation.
| Field Summary |
|---|
| Fields inherited from class org.exolab.castor.jdo.engine.AbstractDatabaseImpl |
|---|
_autoStore, _callback, _classLoader, _ctx, _dbName, _instanceFactory, _lockTimeout, _scope |
| Fields inherited from interface org.exolab.castor.jdo.Database |
|---|
DbLocked, DBLOCKED, Exclusive, EXCLUSIVE, ReadOnly, READONLY, Shared, SHARED |
| Constructor Summary | |
|---|---|
LocalDatabaseImpl(String dbName,
int lockTimeout,
CallbackInterceptor callback,
InstanceFactory instanceFactory,
ClassLoader classLoader,
boolean autoStore)
Creates an instance of this class. |
|
| Method Summary | |
|---|---|
void |
begin()
Begin a new transaction. |
void |
close()
Closes the database. |
void |
commit()
Commits and closes the transaction. |
protected void |
finalize()
Overrides Object.finalize(). |
Connection |
getJdbcConnection()
Gets the underlying JDBC connection. |
void |
rollback()
Rolls back and closes the transaction. |
| Methods inherited from class org.exolab.castor.jdo.engine.AbstractDatabaseImpl |
|---|
create, getCacheManager, getClassLoader, getCurrentTransaction, getDatabaseName, getIdentity, getNamedQuery, getNativeQuery, getOQLQuery, getOQLQuery, getQuery, getScope, getTransaction, isActive, isAutoStore, isClosed, isLocked, isPersistent, load, load, load, loadSynchronizables, lock, registerSynchronizables, remove, setAutoStore, toString, unregisterSynchronizables, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LocalDatabaseImpl(String dbName,
int lockTimeout,
CallbackInterceptor callback,
InstanceFactory instanceFactory,
ClassLoader classLoader,
boolean autoStore)
throws DatabaseNotFoundException
dbName - database namelockTimeout - Lock timeoutcallback - CallbackInterceptor instanceinstanceFactory - Instance factory.classLoader - Current class loaderautoStore - Indicates whether to use 'auto-storing'
DatabaseNotFoundException - If the specified database configuration cannot be found.| Method Detail |
|---|
public void close()
throws PersistenceException
AbstractDatabaseImpl
close in interface Databaseclose in class AbstractDatabaseImplPersistenceException - An error occured while
attempting to close the databaseDatabase.close()
protected void finalize()
throws Throwable
finalize in class ObjectThrowableObject.finalize()
public void begin()
throws PersistenceException
AbstractDatabaseImpl
begin in interface Databasebegin in class AbstractDatabaseImplPersistenceException - A transaction is already open on
this database, or an error reported by the persistence engine
public void commit()
throws TransactionNotInProgressException,
TransactionAbortedException
AbstractDatabaseImplIn other words, any modifications to any data objects which are queried/loaded/created/update to this database is automatically stored to the database and visible to subsequence transactions. (ie. update is solely used for long transaction support and should not be called for any data object queried/loaded/created in the this transaction.)
If the transaction cannot commit, the entire transaction rolls
back and a TransactionAbortedException exception is
thrown.
After this method returns, the transaction is closed and all
persistent objects are transient. Using Database.begin() to open a
new transaction will not restore objects to their persistent
stage.
commit in interface Databasecommit in class AbstractDatabaseImplTransactionNotInProgressException - Method called while
transaction is not in progress
TransactionAbortedException - The transaction cannot
commit and has been rolled back
public void rollback()
throws TransactionNotInProgressException
AbstractDatabaseImpl
rollback in interface Databaserollback in class AbstractDatabaseImplTransactionNotInProgressException - Method called while
transaction is not in progressDatabase.rollback()
public Connection getJdbcConnection()
throws PersistenceException
AbstractDatabaseImpl
getJdbcConnection in interface DatabasegetJdbcConnection in class AbstractDatabaseImplPersistenceException - If the underlying JDBC connection cannot be obtained.Database.getJdbcConnection()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||