Unfortunately, I'm stuck on version 0.9.8. The application that I'm maintaining uses an opaque persistence framework that extends OJB; it creates classes explicitly which have disappeared between 0.9.8 and 1.0RC4. But because I'm using PB calls directly, I'm certain that this problem has nothing to do with the opaque persistence framework. (The value of this software company's persistence framework is dubious; I'll be glad when we can rid ourselves of it.)
"Antonio Gallardo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Sean: > > AFAIK, this would not happen. BTW, what version are you using? > > Best Regards, > > Antonio Gallardo > > Sean Dockery dijo: > > Hello there. > > > > I've had a curious experience recently with OJB, and I was wondering if > > someone could confirm my speculations about the behaviour. > > > > Suppose I have two objects... Product and ProductCategory. The Product > > object carries both a productCategoryId field as well as a reference field > > productCategory which is declared as auto-retrieve in my class descriptor. > > > > Consider the following code segment... > > > > Transaction tx = implementation.newTransaction(); > > tx.begin(); > > PersistenceBroker broker = ((HasBroker) tx).getBroker(); > > Product template = new Product(); > > template.setId(productId); > > Identity identity = new Identity(template, broker); > > Product result = (Product) broker.getObjectByIdentity(identity); > > tx.commit(); > > > > // Thread.sleep(50); > > > > System.out.println(result.getProductCategory().getName()); > > > > Curiously, I sometimes experience a null pointer exception because > > result.getProductCategory() return null. When I uncomment the > > Threat.sleep() call, the null pointer exception never happens. > > > > This seems to suggest that the productCategory reference is being loaded > > by > > another thread. Is this the case or can someone explain why > > Product.getProductCategory returns null for me sometimes when I first > > retrieve the Product object? > > > > Thanks for your time... --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
