public class HibernateDBConnection extends Object implements DBConnection<org.hibernate.Session>
| Constructor and Description |
|---|
HibernateDBConnection() |
| 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.
|
org.hibernate.Session |
getSession()
Access to the underlying persistence provider's session object.
|
protected org.hibernate.Transaction |
getTransaction() |
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)
Evict an entity from the hibernate cache.
|
public org.hibernate.Session getSession()
throws SQLException
DBConnectiongetSession in interface DBConnection<org.hibernate.Session>SQLException - passed through.public boolean isTransActionAlive()
isTransActionAlive in interface DBConnection<org.hibernate.Session>protected org.hibernate.Transaction getTransaction()
public boolean isSessionAlive()
isSessionAlive in interface DBConnection<org.hibernate.Session>public void rollback()
throws SQLException
DBConnectionrollback in interface DBConnection<org.hibernate.Session>SQLException - passed through.public void closeDBConnection()
throws SQLException
DBConnectioncloseDBConnection in interface DBConnection<org.hibernate.Session>SQLException - passed through.public void commit()
throws SQLException
DBConnectioncommit in interface DBConnection<org.hibernate.Session>SQLException - passed through.public void shutdown()
DBConnectionshutdown in interface DBConnection<org.hibernate.Session>public String getType()
DBConnectiongetType in interface DBConnection<org.hibernate.Session>public DataSource getDataSource()
DBConnectiongetDataSource in interface DBConnection<org.hibernate.Session>public DatabaseConfigVO getDatabaseConfig() throws SQLException
DBConnectiongetDatabaseConfig in interface DBConnection<org.hibernate.Session>SQLException - passed through.public long getCacheSize()
throws SQLException
DBConnectiongetCacheSize in interface DBConnection<org.hibernate.Session>SQLException - passed through.public <E extends ReloadableEntity> E reloadEntity(E entity) throws SQLException
DBConnectionreloadEntity in interface DBConnection<org.hibernate.Session>E - type of entityentity - The DSpace object to reloadSQLException - passed through.public void setConnectionMode(boolean batchOptimized,
boolean readOnlyOptimized)
throws SQLException
DBConnectionsetConnectionMode in interface DBConnection<org.hibernate.Session>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.SQLExceptionpublic boolean isOptimizedForBatchProcessing()
DBConnectionisOptimizedForBatchProcessing in interface DBConnection<org.hibernate.Session>public <E extends ReloadableEntity> void uncacheEntity(E entity) throws SQLException
uncacheEntity in interface DBConnection<org.hibernate.Session>E - The class of the enity. The entity must implement the ReloadableEntity interface.entity - The entity to reloadSQLException - When reloading the entity from the database fails.Copyright © 2022 LYRASIS. All rights reserved.