code: private void releaseSessions() throws TTException {
          if (mSessions == null) {
              return;
          }
  
          // Closing all transactions.
          try {
              for (IFilelistenerWriteTrx trx : mTrx.values()) {
                  trx.close();
              }
          } catch (IllegalStateException ise) {
              ise.printStackTrace();
          }
  
          // Closing all storages aswell.
          for (ISession s : mSessions.values()) {
              s.close();
          }
      }
docs: Release transactions and session from treetank.
  
  @throws TTException