【问题标题】:See all DML changes in Oracle session before committing在提交之前查看 Oracle 会话中的所有 DML 更改
【发布时间】:2011-09-30 06:47:29
【问题描述】:

我正在为 Oracle (10g) 存储过程编写测试工具。我打算使用@Transactional 测试来运行存储过程,以便在测试结束时回滚事务。所以我的测试看起来像:

@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);
    }
}

我可以断言已经进行了正确的更新,因为测试会话的本地更改将在测试方法中可见。

但是,为了做出更严格的断言,能够检查会话中已调用但尚未提交的 DML 语句的完整列表会很方便。有没有办法让我看到这个?

【问题讨论】:

    标签: java oracle spring-transactions


    【解决方案1】:
    猜你喜欢
    • 2021-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-26
    • 1970-01-01
    • 2012-12-10
    • 2012-08-25
    • 2017-01-26
    相关资源
    最近更新 更多