I have the following code:
@Test
public void springTest() throws SQLException{
//Connect to the DB.
DriverManagerDataSource dataSou
You need the calls to be wrapped in a single transaction. Typically you'd do this with Spring's AOP + @Transactional annotation in an application. You can also do it programmatically with a PlatformTranactionManager, a TransactionTemplate and wrapping the code to execute in a TransactionCallback. See the transaction documentation.