assertTrue("Not the same PMF",
pmf == JDOHelper.getPersistenceManagerFactory(getPMFProperties()));
}
public void testCreateInTxAndRemoveInTx2PM() {
logger.log(BasicLevel.DEBUG, "testCreateInTxAndRemoveInTx2PM");
BasicA ba = new BasicA();
ba.writeF1("testCreateInTxAndRemoveInTx2PM");
ba.writeF2(2);
Locale l = new Locale("en"); //Examples: "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC"
ba.setLocale(l);
PersistenceManager pm = pmf.getPersistenceManager();
pm.currentTransaction().begin();
pm.makePersistent(ba);
Object id = pm.getObjectId(ba);
Assert.assertNotNull("Null object identifier", id);
assertEquals(BasicA.CALLBACK_INIT, ba.getCheckJdoStore());
assertEquals(BasicA.CALLBACK_INIT, ba.getCheckJdoLoad());
assertEquals(BasicA.CALLBACK_INIT, ba.getCheckJdoClear());
assertEquals(BasicA.CALLBACK_INIT, ba.getCheckJdoDelete());
assertEquals("Bad locale language value", l.getLanguage(), ba.getLocale().getLanguage());
assertEquals("Bad locale country value", l.getCountry(), ba.getLocale().getCountry());
assertEquals("Bad locale variant value", l.getVariant(), ba.getLocale().getVariant());
pm.currentTransaction().commit();
assertEquals(BasicA.CALLBACK_INIT + 1, ba.getCheckJdoStore());
pm.close();
ba = null;
pm = pmf.getPersistenceManager();
pmf.getDataStoreCache().evictAll();
pm.currentTransaction().begin();
ba = (BasicA) pm.getObjectById(id, true);
Assert.assertNotNull("Object not found", ba);
Assert.assertEquals("Bad f1 value", "testCreateInTxAndRemoveInTx2PM", ba.readF1());
Assert.assertEquals("Bad f1 value", 2, ba.readF2());
assertEquals("Bad locale language value", l.getLanguage(), ba.getLocale().getLanguage());
assertEquals("Bad locale country value", l.getCountry(), ba.getLocale().getCountry());
assertEquals("Bad locale variant value", l.getVariant(), ba.getLocale().getVariant());
//assertEquals(BasicA.CALLBACK_INIT + 1, ba.getCheckJdoClear());
assertEquals(BasicA.CALLBACK_INIT, ba.getCheckJdoDelete());
pm.deletePersistent(ba);
assertEquals(BasicA.CALLBACK_INIT + 1, ba.getCheckJdoDelete());
pm.currentTransaction().commit();
try {
Object o = pm.getObjectById(id, true);
if (o != null)