in clicache/integration-test/ThinClientCSTXN.cs [668:743]
public void ThreadStart()
{
RegionOperation o_region1 = new RegionOperation(cstxRegions[0]);
RegionOperation o_region2 = new RegionOperation(cstxRegions[1]);
if (m_tryResumeWithSleep)
{
if (AssertCheckFail(CacheHelper.CSTXManager.IsSuspended(m_tid) == false, "Transaction should not be suspended"))
return;
}
else
{
if (AssertCheckFail(CacheHelper.CSTXManager.IsSuspended(m_tid) == true, "Transaction should be suspended"))
return;
}
if (AssertCheckFail(CacheHelper.CSTXManager.Exists(m_tid) == true, "Transaction should exist"))
return;
if (AssertCheckFail(0 == o_region1.Region.Keys.Count, "There should be 0 values in the region after suspend"))
return;
if (AssertCheckFail(0 == o_region2.Region.Keys.Count, "There should be 0 values in the region after suspend"))
return;
if (m_tryResumeWithSleep)
{
m_txevent.Set();
CacheHelper.CSTXManager.TryResume(m_tid, TimeSpan.FromMilliseconds(30000));
}
else
CacheHelper.CSTXManager.Resume(m_tid);
if (AssertCheckFail(CacheHelper.CSTXManager.IsSuspended(m_tid) == false, "Transaction should not be suspended"))
return;
if (AssertCheckFail(CacheHelper.CSTXManager.Exists(m_tid) == true, "Transaction should exist"))
return;
if (AssertCheckFail(o_region1.Region.Keys.Count == 2, "There should be two values in the region after suspend"))
return;
if (AssertCheckFail(o_region2.Region.Keys.Count == 2, "There should be two values in the region after suspend"))
return;
o_region2.PutOp(2, null);
if (m_isCommit)
{
CacheHelper.CSTXManager.Commit();
if (AssertCheckFail(CacheHelper.CSTXManager.IsSuspended(m_tid) == false, "Transaction should not be suspended"))
return;
if (AssertCheckFail(CacheHelper.CSTXManager.Exists(m_tid) == false, "Transaction should NOT exist"))
return;
if (AssertCheckFail(CacheHelper.CSTXManager.TryResume(m_tid) == false, "Transaction should not be resumed"))
return;
if (AssertCheckFail(CacheHelper.CSTXManager.TryResume(m_tid, TimeSpan.FromMilliseconds(3000)) == false, "Transaction should not be resumed"))
return;
if (AssertCheckFail(2 == o_region1.Region.Keys.Count, "There should be four values in the region after commit"))
return;
if (AssertCheckFail(4 == o_region2.Region.Keys.Count, "There should be four values in the region after commit"))
return;
o_region1.DestroyOpWithPdxValue(1, null);
o_region2.DestroyOpWithPdxValue(2, null);
}
else
{
CacheHelper.CSTXManager.Rollback();
if (AssertCheckFail(CacheHelper.CSTXManager.IsSuspended(m_tid) == false, "Transaction should not be suspended"))
return;
if (AssertCheckFail(CacheHelper.CSTXManager.Exists(m_tid) == false, "Transaction should NOT exist"))
return;
if (AssertCheckFail(CacheHelper.CSTXManager.TryResume(m_tid) == false, "Transaction should not be resumed"))
return;
if (AssertCheckFail(CacheHelper.CSTXManager.TryResume(m_tid, TimeSpan.FromMilliseconds(3000)) == false, "Transaction should not be resumed"))
return;
if (AssertCheckFail(0 == o_region1.Region.Keys.Count, "There should be 0 values in the region after rollback"))
return;
if (AssertCheckFail(0 == o_region2.Region.Keys.Count, "There should be 0 values in the region after rollback"))
return;
}
}