{
REPORT("start transactionalProperties");
// put a couple of properties in with different values and types
tc.setProperty("T_Key_Frog", new SQLLongint(479), false);
tc.setProperty("T_Key_Tiger", "Roar, ROAR", false);
long lvalue = ((SQLLongint) (tc.getProperty("T_Key_Frog"))).getLong();
if (lvalue != 479)
throw T_Fail.testFailMsg("setProperty() - expected 479 - got " + lvalue);
String svalue = (String) tc.getProperty("T_Key_Tiger");
if (!svalue.equals("Roar, ROAR"))
throw T_Fail.testFailMsg("setProperty() - expected 'Roar, ROAR' - got " + svalue);
tc.commit();
// should still be accessable after the commit
lvalue = ((SQLLongint) (tc.getProperty("T_Key_Frog"))).getLong();
if (lvalue != 479)
throw T_Fail.testFailMsg("setProperty() - expected 479 - got " + lvalue);
svalue = (String) tc.getProperty("T_Key_Tiger");
if (!svalue.equals("Roar, ROAR"))
throw T_Fail.testFailMsg("setProperty() - expected 'Roar, ROAR' - got " + svalue);
tc.commit();
// see if update works
tc.setProperty("T_Key_Tiger", "mieow, mieow", false);
svalue = (String) tc.getProperty("T_Key_Tiger");
if (!svalue.equals("mieow, mieow"))
throw T_Fail.testFailMsg("setProperty() - expected 'mieow, mieow' - got " + svalue);
tc.commit();
svalue = (String) tc.getProperty("T_Key_Tiger");
if (!svalue.equals("mieow, mieow"))
throw T_Fail.testFailMsg("setProperty() - expected 'mieow, mieow' - got " + svalue);
// see if an update to a different type works
tc.setProperty("T_Key_Tiger", new SQLLongint(570), false);
lvalue = ((SQLLongint) (tc.getProperty("T_Key_Tiger"))).getLong();
if (lvalue != 570)
throw T_Fail.testFailMsg("setProperty() - expected 570 - got " + lvalue);
tc.commit();
lvalue = ((SQLLongint) (tc.getProperty("T_Key_Tiger"))).getLong();
if (lvalue != 570)
throw T_Fail.testFailMsg("setProperty() - expected 570 - got " + lvalue);
tc.commit();
// delete a key
tc.setProperty("T_Key_Frog", (Serializable) null, false);
if (tc.getProperty("T_Key_Frog") != null)
throw T_Fail.testFailMsg("setProperty() - delete failed");
tc.commit();
if (tc.getProperty("T_Key_Frog") != null)
throw T_Fail.testFailMsg("setProperty() - delete failed");
tc.commit();
// now see if rollback works.
tc.setProperty("T_Key_Tiger", new SQLLongint(457), false);
tc.abort();
lvalue = ((SQLLongint) (tc.getProperty("T_Key_Tiger"))).getLong();
if (lvalue != 570)
throw T_Fail.testFailMsg("setProperty() - expected 570 - got " + lvalue);