public void stopThread(){
  stop=true;
synchronized (this) {
    notify();
  }
}

public void stopThread ( ) { stop = true ; synchronized ( this ) { notify ( ) ; } }
stop the thread . this method is called when closing the database .
