Package net.sf.basedb.core
Class DbControl.State
java.lang.Object
net.sf.basedb.core.DbControl.State
- All Implemented Interfaces:
Runnable
- Enclosing class:
- DbControl
static class DbControl.State extends Object implements Runnable
Main purpose is to write a warning to the log file in case some user code that
created a DbControl instance never called the close() method before the DbControl
became uncreachable. This can cause memory leaks. As an extra safety guarding agains
unclosed database connections this class also holds the Hibernate
session/transaction so that they can be closed. NOTE! This is NOT a replacement for
a proper call to close() or commit() since there are a lot of actions that are not
performed by this class. For example, Batchers and TransactionalActions are not
performed.
- Since:
- 3.16
-
Field Summary
Fields Modifier and Type Field Description (package private) Cleaner.Cleanable
cleanable
(package private) SessionWrapper
hSession
private StatelessSessionWrapper
hStatelessSession
(package private) Transaction
hTransaction
(package private) Throwable
stacktrace
-
Constructor Summary
Constructors Constructor Description State()
-
Method Summary
Modifier and Type Method Description (package private) void
explicitClean()
Explicit cleanup of the DbControl is happening.void
run()
-
Field Details
-
hSession
SessionWrapper hSession -
hTransaction
Transaction hTransaction -
hStatelessSession
-
stacktrace
Throwable stacktrace -
cleanable
Cleaner.Cleanable cleanable
-
-
Constructor Details
-
State
State()
-
-
Method Details
-
explicitClean
void explicitClean()Explicit cleanup of the DbControl is happening. The hSession, hTransaction, etc. should already have been closed via commit() or rollback(). We simply nullify everything and invoke the clean() method to unregister ourselves from the Cleaner. -
run
public void run()
-