SITransactorTest.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:spliceengine 作者:
@Test
public void writeDeleteOverlap() throws IOException {
    Txn t1 = control.beginTransaction();
    t1 = t1.elevateToWritable(DESTINATION_TABLE);
    testUtility.insertAge(t1, "joe2", 20);

    Txn t2 = control.beginTransaction(DESTINATION_TABLE);
    try {
        testUtility.deleteRow(t2, "joe2");
        Assert.fail("No Write conflict was detected!");
    } catch (IOException e) {
        testUtility.assertWriteConflict(e);
    } finally {
        t2.rollback();
    }
    Assert.assertEquals("joe2 age=20 job=null", testUtility.read(t1, "joe2"));
    t1.commit();
    error.expect(IsInstanceOf.instanceOf(CannotCommitException.class));
    error.expectMessage(String.format("[%1$d]Transaction %1$d cannot be committed--it is in the %2$s state",t2.getTxnId(),Txn.State.ROLLEDBACK));
    t2.commit();
    Assert.fail("Did not throw CannotCommit exception!");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号