You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Vamsi Atluri <vk...@yahoo.com> on 2006/05/11 16:09:12 UTC
Intermitter error ...
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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Intermitter error ...
Posted by Vamsi Atluri <vk...@yahoo.com>.
Hi Armin,
My broker factory is:
PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl
Connection factory class is:
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl
Persistence broker pool settings are:
maxActive=100
maxIdle=-1
maxWait=2000
timeBetweenEvictionRunsMillis=-1
minEvictableIdleTimeMillis=1000000
whenExhaustedAction=2
My jdbc connection descriptor is:
<jdbc-connection-descriptor
jcd-alias="OJBDb"
default-connection="true"
platform="Db2"
jdbc-level="1.0"
jndi-datasource-name="jdbc/ojbDataSource"
username="rrtools"
password="Parul1da"
batch-mode="false"
useAutoCommit="0"
ignoreAutoCommitExceptions="false">
<sequence-manager className="org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl">
<attribute attribute-name="grabSize" attribute-value="1"></attribute>
</sequence-manager>
</jdbc-connection-descriptor>
Even after using clearCache() i run into this issue. How do I solve the null pointers?
Coming to the rollback issue, I use the same broker through out for storage and this broker is obtained after the UserTransaction is started.
Thanks for your help.
-Vamsi
----- Original Message ----
From: Armin Waibel <ar...@apache.org>
To: OJB Users List <oj...@db.apache.org>
Sent: Thursday, May 11, 2006 1:17:00 PM
Subject: Re: Intermitter error ...
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 <ar...@apache.org>
> To: OJB Users List <oj...@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: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Intermitter error ...
Posted by Armin Waibel <ar...@apache.org>.
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 <ar...@apache.org>
> To: OJB Users List <oj...@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: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Intermitter error ...
Posted by Vamsi Atluri <vk...@yahoo.com>.
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.
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?
-Vamsi
----- Original Message ----
From: Armin Waibel <ar...@apache.org>
To: OJB Users List <oj...@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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Intermitter error ...
Posted by Armin Waibel <ar...@apache.org>.
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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org