String testValue2 = "testNonTransactional-2";
String propertyKey3 = "testNonTransactional-3";
String testValue3 = "testNonTransactional-3";
try {
PropertyManager pm = PropertyManager.getInstance();
Property p1 = pm.createPropertyInstance(null, null, null, null, propertyKey1, null, null, testValue1, null);
pm.saveProperty(p1);
Property p2 = pm.createPropertyInstance(null, null, null, null, propertyKey2, null, null, testValue2, null);
pm.saveProperty(p2);
// name is null => generated DB error => rollback ?
Property p3 = pm.createPropertyInstance(null, null, null, null, null, null, null, testValue3, null);
pm.saveProperty(p3);
fail("Should generate error for rollback.");
db.closeSession();
} catch (Exception ex) {
db.closeSession();
}
// check if p1 & p2 is NOT rollbacked
PropertyManager pm = PropertyManager.getInstance();
Property p_1 =pm.findProperty(null, null, null, null, propertyKey1);
this.assertNull("Property1 is NOT rollbacked", p_1);
Property p_2 =pm.findProperty(null, null, null, null, propertyKey2);
this.assertNull("Property2 is NOT rollbacked", p_2);
}