@Override public void commit(){
  if (writeCache != null) {
synchronized (this) {
      flushWriteCache();
    }
  }
  super.commit();
}

@ Override public void commit ( ) { if ( writeCache != null ) { synchronized ( this ) { flushWriteCache ( ) ; } } super . commit ( ) ; }
need to override commit to ensure the writecache is flushed prior to writing the root block . for the diskonlystrategy flushing the writecache also ensures the backing file is created if the file is temporary . note that the internal call to flush the writecache must be synchronized or concurrent writers to the cache will cause problems .
