Vamsi Atluri wrote:
Hi Armin,
I am using OJB1.0.1 on WSAD 5.1 using JDK1.3.1. I have a simple table of the form: TABLE: BOOK_VERSION_DEF BOOK_ID INTEGER (PK)
BOOK_VERSION_ID    INTEGER (PK)
CREATION_DATE        DATE
And my query code is like this: Criteria bookVersionCriteria = new Criteria();
bookVersionCriteria.addEqualTo("bookId", Integer.valueOf("1"));
QueryByCriteria bookVersionQuery = new QueryByCriteria(BookVersionDef.class, 
bookVersionCriteria);
Collection bookVersionDefs = broker.getCollectionByQuery(bookVersionQuery);
It is a very straight forward case. As for threads, I am using WebSphere's DataSource, so I am guessing there is on PB per thread. Also, if I do broker.clearCache() just before running the query, I don't run into this problem. I don't know if it solved it, but as the problem is intermittent, I am not sure if broker.clearCache() fixed it.

Strange! The posted stack trace indicate that you work on a closed/not open PB instance because

[5/11/06 10:02:15:498 EDT] 24df24df SystemErr R at java.lang.NullPointerException.(NullPointerException.java:60) > [5/11/06 10:02:15:498 EDT] 24df24df SystemErr R at org.apache.ojb.broker.core.PersistenceBrokerImpl.getClassDescriptor(PersistenceBrokerImpl.java)

method PB.getClassDescriptor(...) seems to cause the NPE. The method itself does:

public ClassDescriptor getClassDescriptor(Class clazz) throws PersistenceBrokerException
{
   return descriptorRepository.getDescriptorFor(clazz);
}

and 'descriptorRepository' is only null when PB instance is closed. Which PersistenceBrokerFactory do you use?


Now, I have one more question. If I have a process that does multiple broker.store()s within a UserTransaction boundary, if I do a broker.clearCache() before each store()
call, if there is a roll back will all db actions be rolled back?


If you use the same broker instance (or use datasources in managed environment) and the broker instance was created after the UT starts - yes. The synchronization of the cache depends on the used implementation/configuration.

regards,
Armin


-Vamsi

----- Original Message ----
From: Armin Waibel <[EMAIL PROTECTED]>
To: OJB Users List <ojb-user@db.apache.org>
Sent: Thursday, May 11, 2006 10:49:51 AM
Subject: Re: Intermitter error ...


Hi Vamsi,

could post more details of the used OJB version and how you are using OJB? Could it be a concurrency issue, is it guaranteed that each thread use it's own PB instance?

regards,
Armin

Vamsi Atluri wrote:
Hello all, I am getting this error when I am doing a broker.getCollectionByQuery() very intermittently. The same piece of code works some times and fails some times with this error: [5/11/06 10:02:15:498 EDT] 24df24df SystemErr R java.lang.NullPointerException [5/11/06 10:02:15:498 EDT] 24df24df SystemErr R at java.lang.Throwable.(Throwable.java) [5/11/06 10:02:15:498 EDT] 24df24df SystemErr R at java.lang.Throwable.(Throwable.java) [5/11/06 10:02:15:498 EDT] 24df24df SystemErr R at java.lang.NullPointerException.(NullPointerException.java:60) [5/11/06 10:02:15:498 EDT] 24df24df SystemErr R at org.apache.ojb.broker.core.PersistenceBrokerImpl.getClassDescriptor(PersistenceBrokerImpl.java) [5/11/06 10:02:15:498 EDT] 24df24df SystemErr R at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java) [5/11/06 10:02:15:498 EDT] 24df24df SystemErr R at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java) [5/11/06 10:02:15:508 EDT] 24df24df SystemErr R at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:253) [5/11/06 10:02:15:508 EDT] 24df24df SystemErr R at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1217) [5/11/06 10:02:15:508 EDT] 24df24df SystemErr R at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:338) [5/11/06 10:02:15:508 EDT] 24df24df SystemErr R at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:338) Does anybody have a clue why this might happen very intermittently? Since, it is intermittent it is very hard to debug. -Vamsi

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



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

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



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

Reply via email to