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 Details

  • 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()
      Specified by:
      run in interface Runnable