T - type of the persistence provider's session object.public interface DBConnection<T>
This class should only be accessed by an enclosing Context object.
Note that the user's HTTPSession is an unrelated concept.
| Modifier and Type | Method and Description |
|---|---|
void |
closeDBConnection()
Close this session: close DBMS connection(s) and clean up resources.
|
void |
commit()
Commit the open transaction.
|
long |
getCacheSize()
How many entities are cached in this session?
|
DatabaseConfigVO |
getDatabaseConfig()
Identify certain characteristics of the DBMS being used to support persistence.
|
DataSource |
getDataSource()
The JDBC DataSource used by this session.
|
T |
getSession()
Access to the underlying persistence provider's session object.
|
String |
getType()
Some description of the DBMS used to persist entities.
|
boolean |
isOptimizedForBatchProcessing()
Has this session been configured for large batches? Typically this means
that automatic flushing of updates to the database is suppressed, and
thus one must take care to flush manually (or commit) at appropriate times.
|
boolean |
isSessionAlive() |
boolean |
isTransActionAlive() |
<E extends ReloadableEntity> |
reloadEntity(E entity)
Reload a DSpace object from the database.
|
void |
rollback()
Roll back the open transaction.
|
void |
setConnectionMode(boolean batchOptimized,
boolean readOnlyOptimized)
Configure the connection for special uses.
|
void |
shutdown()
Close all sessions.
|
<E extends ReloadableEntity> |
uncacheEntity(E entity)
Remove a DSpace object from the session cache when batch processing a
large number of objects.
|
T getSession() throws SQLException
SQLException - passed through.boolean isTransActionAlive()
boolean isSessionAlive()
void commit()
throws SQLException
SQLException - passed through.void rollback()
throws SQLException
SQLException - passed through.void closeDBConnection()
throws SQLException
SQLException - passed through.void shutdown()
String getType()
DataSource getDataSource()
DatabaseConfigVO getDatabaseConfig() throws SQLException
SQLException - passed through.void setConnectionMode(boolean batchOptimized,
boolean readOnlyOptimized)
throws SQLException
batchOptimized - if true, optimize for batch use. Typically this
means suppressing automatic flushing of updates, thus requiring manual
flushing at appropriate points in the process.readOnlyOptimized - if true, optimize for read-only use. Typically
this suppresses all updating.SQLExceptionboolean isOptimizedForBatchProcessing()
long getCacheSize()
throws SQLException
SQLException - passed through.<E extends ReloadableEntity> E reloadEntity(E entity) throws SQLException
E - type of entityentity - The DSpace object to reloadSQLException - passed through.<E extends ReloadableEntity> void uncacheEntity(E entity) throws SQLException
Objects removed from cache are not saved in any way. Therefore, if you
have modified an object, you should be sure to commit() changes
before calling this method.
E - Type of entityentity - The DSpace object to decache.SQLExceptionCopyright © 2022 LYRASIS. All rights reserved.