{
String bindingName = "binding_for_testDoubleBindInOneTx";
DList foundList = null;
// 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();
db.bind(odmg.newDList(), bindingName);
foundList = (DList)db.lookup(bindingName);
assertTrue("Could not found bound DList", foundList != null);
foundList = null;
db.unbind(bindingName);
try
{
foundList = (DList) db.lookup(bindingName);
fail("Found unbound DList");
}
catch (ObjectNameNotFoundException ex)
{
}
db.bind(odmg.newDList(), bindingName);
try
{
foundList = (DList) db.lookup(bindingName);
}
catch (ObjectNameNotFoundException ex)
{
fail("Could not found bound DList, binding name was: "+bindingName);
}
foundList = null;
tx.commit();
tx = odmg.newTransaction();
tx.begin();
try
{
DList newList = (DList)db.lookup(bindingName);
db.unbind(bindingName);