Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.SimpleTransactionStatus


    @Test
    public void rollingBackDelegatesToOriginalContexts() throws SQLException {
        Connection connection = TestDatabaseProvider.createInMemoryHSQLDataSource().getConnection();
        try {
            SimpleTransactionStatus status = new SimpleTransactionStatus();
            SpringTransactionContext context = new SpringTransactionContext(status, connection);

            assertThat(context.getConnection(), is(connection));

            assertThat(context.isRollbackOnly(), is(false));
            assertThat(status.isRollbackOnly(), is(false));
            context.setRollbackOnly();
            assertThat(context.isRollbackOnly(), is(true));
            assertThat(status.isRollbackOnly(), is(true));

        }finally {
            connection.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.transaction.support.SimpleTransactionStatus

Copyright © 2018 www.massapicom. 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.