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

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

Introduction

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

Prototype

public static <T> List<T> createTransactionalList() 

Source Link

Usage

From source file:org.springframework.batch.core.launch.EmptyItemWriter.java

@Override
public void afterPropertiesSet() throws Exception {
    list = TransactionAwareProxyFactory.createTransactionalList();
}

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

@Ignore("This fails too often and is a false negative")
@Test/*w  w w  .j  av  a  2  s .  c o m*/
public void testConcurrentTransactionalList() throws Exception {
    List<String> list = TransactionAwareProxyFactory.createTransactionalList();
    try {
        testList(list, true);
        fail("Expected ExecutionException or AssertionError (but don't panic if it didn't happen: it probably just means we got lucky for a change)");
    } catch (ExecutionException e) {
        String message = e.getCause().getMessage();
        assertTrue("Wrong message: " + message, message.startsWith("Lost update"));
    } catch (AssertionError e) {
        String message = e.getMessage();
        assertTrue("Wrong message: " + message, message.startsWith("Wrong number of results"));
    }
}