Transaction
293294295296297298299300301302303
} // clear named roots. clearNRM(); Transaction tx = odmg.newTransaction(); // 1. perform binding tx.begin(); Article example = createArticle();
311312313314315316317318319320321
tx.abort(); fail(ex.getMessage()); } // 2. perform unbind tx = odmg.newTransaction(); tx.begin(); try { db.unbind(name); tx.commit();
325326327328329330331332333334335
tx.abort(); fail("name " + name + "should be known"); } // 3. check if name is really unknown now tx = odmg.newTransaction(); tx.begin(); try { Article value = (Article) db.lookup(name); }
9596979899100101102103104105
} catch (ODMGException ex) { fail("ODMGException: " + ex.getMessage()); } Transaction tx = odmg.newTransaction(); //perform transaction try { tx.begin();
146147148149150151152153154155156
205206207208209210211212213214215
} catch (ODMGException ex) { fail("ODMGException: " + ex.getMessage()); } Transaction tx = odmg.newTransaction(); // perform transaction tx.begin(); OQLQuery query = odmg.newOQLQuery();
250251252253254255256257258259260
271272273274275276277278279280281
String name = "gimme fruits_" + System.currentTimeMillis(); db.bind(results, name); tx.commit(); tx = odmg.newTransaction(); tx.begin(); ((TransactionImpl) tx).getBroker().clearCache(); // look it up again
319320321322323324325326327328329
375376377378379380381382383384385
// get facade instance Implementation odmg = OJB.getInstance(); Database db = odmg.newDatabase(); //open database db.open(databaseName, Database.OPEN_READ_WRITE); Transaction tx = odmg.newTransaction(); //perform transaction try { tx.begin();