Example usage for org.springframework.batch.support.transaction TransactionAwareProxyFactory createAppendOnlyTransactionalMap

List of usage examples for org.springframework.batch.support.transaction TransactionAwareProxyFactory createAppendOnlyTransactionalMap

Introduction

In this page you can find the example usage for org.springframework.batch.support.transaction TransactionAwareProxyFactory createAppendOnlyTransactionalMap.

Prototype

public static <K, V> ConcurrentMap<K, V> createAppendOnlyTransactionalMap() 

Source Link

Usage

From source file:org.springframework.batch.support.transaction.ConcurrentTransactionAwareProxyTests.java

@Test
public void testConcurrentTransactionalAppendOnlyMap() throws Exception {
    Map<Long, Map<String, String>> map = TransactionAwareProxyFactory.createAppendOnlyTransactionalMap();
    testMap(map);//from   ww  w  . j a v  a  2  s.co  m
}

From source file:org.springframework.batch.support.transaction.ConcurrentTransactionAwareProxyTests.java

@Test
public void testTransactionalContains() throws Exception {
    final Map<Long, Map<String, String>> map = TransactionAwareProxyFactory.createAppendOnlyTransactionalMap();
    boolean result = new TransactionTemplate(transactionManager).execute(new TransactionCallback<Boolean>() {
        @Override// ww w.j a  v  a2s .  c om
        public Boolean doInTransaction(TransactionStatus status) {
            return map.containsKey("foo");
        }
    });
    assertFalse(result);
}