See all DML changes in Oracle session before committing
I'm writing a test harness for an Oracle (10g) stored procedure. I'm planning to use a @Transactional
test to run the stored procedure, so that the transaction will be rolled back when the test ends. So my test looks like:
@ContextConfiguration(locations = "classpath:spring/ITestAssembly.xml")
@RunWith(SpringJUnit4ClassRunner.class)
public class ContentGenerationRunnerTest {
@Autowired
private JdbcTemplate jdbcTemplate;
@Test
@Transactional
public void contentIncShouldRun() throws Exception {
new ContentGenerationRunner().runVclBec(jdbcTemplate);
}
}
I can assert that the correct updates have been made, since the changes local to the test's session will be visible within the test method.
开发者_运维知识库However to make more strict assertions, it'd be handy to be able to check for a complete list of DML statements that have been called in the session, but not yet committed. Is there a way I can see this?
Related question:
https://dba.stackexchange.com/questions/2994/oracle-any-way-to-view-uncommited-changes-to-a-particular-table
精彩评论