If my application is using the ODMG personality of OJB a la...

Implementation odmg = OBJ.getInstance();
...

Is it safe for other parts of my code to use a PersistenceBroker like
this...

PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
try {
    // ...
}
finally {
    broker.close();
}

...or should I always (on pain of death) get a PersistenceBroker like
this...

Implementation odmg = OJB.getInstance();
Transaction tx = odmg.newTransaction();
tx.begin();
PersistenceBroker broker = ((HasBroker) tx).getBroker();
//...
tx.commit();





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to