Added PersistenceContext.shutdown(), exposed shutdown() in ConnectionProvider.
This commit is contained in:
@@ -141,6 +141,22 @@ public class PersistenceContext
|
|||||||
_cache = adapter;
|
_cache = adapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shuts this persistence context down, shutting down any caching system in use and shutting
|
||||||
|
* down the JDBC connection pool.
|
||||||
|
*/
|
||||||
|
public void shutdown ()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (_cache != null) {
|
||||||
|
_cache.shutdown();
|
||||||
|
}
|
||||||
|
} catch (Throwable t) {
|
||||||
|
log.log(Level.WARNING, "Failure shutting down Depot cache.", t);
|
||||||
|
}
|
||||||
|
_conprov.shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and return a new {@link SQLBuilder} for the appropriate dialect.
|
* Create and return a new {@link SQLBuilder} for the appropriate dialect.
|
||||||
*
|
*
|
||||||
@@ -183,7 +199,8 @@ public class PersistenceContext
|
|||||||
* and register a pre-migration for every single schema migration and they will then be
|
* and register a pre-migration for every single schema migration and they will then be
|
||||||
* guaranteed to be run in registration order and with predictable pre- and post-conditions.
|
* guaranteed to be run in registration order and with predictable pre- and post-conditions.
|
||||||
*/
|
*/
|
||||||
public <T extends PersistentRecord> void registerMigration (Class<T> type, EntityMigration migration)
|
public <T extends PersistentRecord> void registerMigration (
|
||||||
|
Class<T> type, EntityMigration migration)
|
||||||
{
|
{
|
||||||
getRawMarshaller(type).registerMigration(migration);
|
getRawMarshaller(type).registerMigration(migration);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user