public void test_sessionProtection(){
  final Journal store=(Journal)getStore();
  try {
    final RWStrategy bs=(RWStrategy)store.getBufferStrategy();
    final RWStore rw=bs.getStore();
    final byte[] buf=new byte[300];
    r.nextBytes(buf);
    final ByteBuffer bb=ByteBuffer.wrap(buf);
    long faddr=bs.write(bb);
    IRawTx tx=rw.newTx();
    bs.delete(faddr);
    bb.position(0);
    final ByteBuffer rdBuf=bs.read(faddr);
    assertEquals(bb,rdBuf);
    tx.close();
    store.commit();
  }
  finally {
    store.destroy();
  }
}

public void test_sessionProtection ( ) { final Journal store = ( Journal ) getStore ( ) ; try { final RWStrategy bs = ( RWStrategy ) store . getBufferStrategy ( ) ; final RWStore rw = bs . getStore ( ) ; final byte [ ] buf = new byte [ 300 ] ; r . nextBytes ( buf ) ; final ByteBuffer bb = ByteBuffer . wrap ( buf ) ; long faddr = bs . write ( bb ) ; IRawTx tx = rw . newTx ( ) ; bs . delete ( faddr ) ; bb . position ( 0 ) ; final ByteBuffer rdBuf = bs . read ( faddr ) ; assertEquals ( bb , rdBuf ) ; tx . close ( ) ; store . commit ( ) ; } finally { store . destroy ( ) ; } }
tests whether tasks are able to access and modify data safely by emulating transactions by calling activatetx and deactivatetx directly .
