private void executeOperation ( DbUnitDatabasePopulator populator , DataSource dataSource ) throws Exception { Connection connection = null ; try { connection = getConnection ( dataSource ) ; populator . populate ( connection ) ; } finally { if ( connection != null && ! isConnectionTransactional ( connection , dataSource ) ) { // if the connection is transactional, closing it. Otherwise, // expects that the framework will do it releaseConnection ( connection , dataSource ) ; } } }
Execute a DBUbit operation