}
public void testAdding() throws Exception
{
// get facade instance
Implementation odmg = OJB.getInstance();
Database db = odmg.newDatabase();
//open database
db.open(databaseName, Database.OPEN_READ_WRITE);
Transaction tx = odmg.newTransaction();
tx.begin();
DMap map = odmg.newDMap();
PersistenceBroker broker = ((HasBroker) tx).getBroker();
String name = null;
try
{
// name = "the_dmap_" + (broker.getUniqueId(DMapImpl.class, "id") - 1);
name = "the_dmap_" + System.currentTimeMillis();
}
catch (PersistenceBrokerException e)
{
}
db.bind(map, name);
Article key1 = createArticle(odmg);
Article val1 = createArticle(odmg);
Article key2 = createArticle(odmg);
Article val2 = createArticle(odmg);
map.put(key1, val1);
map.put(key2, val2);
tx.commit();
tx = odmg.newTransaction();
tx.begin();
broker = ((HasBroker) tx).getBroker();
broker.clearCache();