Examples of TxCacheWrapper


Examples of org.gridkit.coherence.txlite.TxCacheWrapper

   
    TxManager txman = new TxManager(superviser);
   
    TxSession readSession = txman.openReadOnlySession();
    NamedCache readA = readSession.connect(cacheA);
    TxCacheWrapper dirtyA = new TxCacheWrapper(cacheA, new DirtyReadCacheAccessAdapter());
   
    TxSession writeSession = txman.openReadWriteSession();
    NamedCache writeA = writeSession.connect(cacheA);
   
    Assert.assertThat(readA.get("A"), IsNull.nullValue());
    Assert.assertThat(dirtyA.get("A"), IsNull.nullValue());
    Assert.assertThat(writeA.get("A"), IsNull.nullValue());
   
    writeA.put("A", "A");
   
    Assert.assertThat(readA.get("A"), IsNull.nullValue());
    Assert.assertThat((String)dirtyA.get("A"), Is.is("A"));
    Assert.assertThat((String)writeA.get("A"), Is.is("A"));
   
    writeSession.commit();
    Assert.assertThat(readA.get("A"), IsNull.nullValue());
    readSession.commit();
View Full Code Here

Examples of org.gridkit.coherence.txlite.TxCacheWrapper

   
    TxManager txman = new TxManager(superviser);
   
    TxSession readSession = txman.openReadOnlySession();
    NamedCache readA = readSession.connect(cacheA);
    TxCacheWrapper dirtyA = new TxCacheWrapper(cacheA, new DirtyReadCacheAccessAdapter());
   
    TxSession writeSession = txman.openReadWriteSession();
    NamedCache writeA = writeSession.connect(cacheA);
   
    Assert.assertThat(readA.get("A"), IsNull.nullValue());
    Assert.assertThat(dirtyA.get("A"), IsNull.nullValue());
    Assert.assertThat(writeA.get("A"), IsNull.nullValue());
   
    writeA.put("A", "A");
   
    Assert.assertThat(readA.get("A"), IsNull.nullValue());
    Assert.assertThat((String)dirtyA.get("A"), Is.is("A"));
    Assert.assertThat((String)writeA.get("A"), Is.is("A"));
   
    writeSession.rollback();
    Assert.assertThat(readA.get("A"), IsNull.nullValue());
    readSession.commit();
    Assert.assertThat(readA.get("A"), IsNull.nullValue());
    Assert.assertThat(dirtyA.get("A"), IsNull.nullValue());
    Assert.assertThat(writeA.get("A"), IsNull.nullValue());
    writeSession.rollback();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.