Package net.sf.basedb.core
Class DbControl.State
java.lang.Object
net.sf.basedb.core.DbControl.State
- All Implemented Interfaces:
Runnable
- Enclosing class:
- DbControl
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
Modifier and TypeFieldDescription(package private) Cleaner.Cleanable
(package private) SessionWrapper
private StatelessSessionWrapper
(package private) Transaction
(package private) Throwable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
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()
-