> That does bring up the one real question I do have: There was a new > broker.OJB object that was introduced. All the examples talked about > doing ojb.lookupBroker() to get a PB instance. We use to do > PersistenceBrokerFactory.defaultPersistenceBroker(), but I am not sure > if that is considered the best way anymore. I tried moving to using > ojb.lookupBroker(), but unless I kept a static reference to the OJB > object, every time I would create a new broker, it would think that it > needed to do all the initialization work, and would also give me a fresh > cache.
That's right, the PersistenceBrokerFactory is for backward compatibility only. The prefered way of holding onto an instance of said OJB class is either using ThreadLocal (e.g. for normal applications; this is what the PersistenceBrokerFactory does) or the application session (for web applications). The examples havn't been updated yet (I'm in the process of reworking the tutorials for the 1.0 branch, and will update them for the CVS Head too). > Now as I am typing this, I realize that with the introduction of IOC, > that my wrapper class should really utilize the Pico container and get > it's instance of OJB from that. Yep, that was one of the envisioned uses (esp. when using with Spring), though to be honest I havn't tried it this way yet :-) Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
