tx.commit();
}
public void testSimpleQueryDelete() throws Exception
{
Implementation odmg = OJB.getInstance();
Database db = odmg.newDatabase();
String name = "testSimpleQueryDelete - " + System.currentTimeMillis();
db.open(databaseName, Database.OPEN_READ_WRITE);
Site site = new Site();
site.setName(name);
Transaction tx = odmg.newTransaction();
tx.begin();
tx.lock(site, Transaction.WRITE);
tx.commit();
OQLQuery query = odmg.newOQLQuery();
query.create("select sites from " + Site.class.getName() + " where name=$1");
query.bind(name);
tx.begin();
List result = (List) query.execute();
if (result.size() == 0)
{
fail("Stored object not found");
}
tx.commit();
tx.begin();
db.deletePersistent(site);
tx.commit();
query = odmg.newOQLQuery();
query.create("select sites from " + Site.class.getName() + " where name=$1");
query.bind(name);
tx.begin();
List result2 = (List) query.execute();
if (result2.size() > 0)