exception with CriteriaQueryRunner

Jay Shaughnessy jshaughn at redhat.com
Tue May 28 14:45:07 UTC 2013


I think that's a possible explanation.  Although those two queries run 
in the same transaction the standard READ_COMMITTED isolation level will 
allow for a different number of rows to be returned (or counted) for 
each.  In general, as paging queries happen the chance of "totalRows" 
changing increases, as the elapsed time from the original query increases.

You are right, I think, about the unlimited queries.  Performing a 
subsequent count query doesn't make much sense as we should be able to 
use the original result set size.

We need to take a closer look at the Criteria paging handling...


On 5/27/2013 3:55 PM, Andreas Veithen wrote:
> I've seen a similar exception with
> findResourceOperationHistoriesByCriteria. My analysis of that
> particular problem [1] led to the following conclusion:
>
> // findResourceOperationHistoriesByCriteria may occasionally fail. The
> reason is that it executes two queries:
> // one to retrieve the data and one to determine the total number of
> rows (note that this is basically
> // useless since we are using PageControl.getUnlimitedInstance()). If
> the operation history is created
> // just between these two queries, then there is a mismatch and an
> exception is triggered
> // ("PageList was passed an empty collection but 'totalSize' was 1,
> PageControl[page=0, size=-1]").
>
> May be the same issue here.
>
> Andreas
>
> [1] https://code.google.com/p/rhq-websphere-plugin/source/detail?r=444
>
> On Thu, May 23, 2013 at 8:31 PM, John Sanda <jsanda at redhat.com> wrote:
>> I'm hitting the following exception regularly,
>>
>> 1:19:21,821 ERROR [org.jboss.as.ejb3.invocation] (RHQScheduler_Worker-3) JBAS014134: EJB Invocation failed on component MeasurementDefinitionManagerBean for method public abstract org.rhq.core.domain.util.PageList org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal.findMeasurementDefinitionsByCriteria(org.rhq.core.domain.auth.Subject,org.rhq.core.domain.criteria.MeasurementDefinitionCriteria): javax.ejb.EJBTransactionRolledbackException: PageList was passed an empty collection but 'totalSize' was 146, PageControl[page=1, size=200, sort[id ASC]]
>> .
>> .
>> .
>>          at org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal$$$view50.findMeasurementDefinitionsByCriteria(Unknown Source) [rhq-enterprise-server-ejb3.jar:4.8.0-SNAPSHOT]
>>          at org.rhq.enterprise.server.resource.metadata.MeasurementMetadataManagerBean$1.execute(MeasurementMetadataManagerBean.java:227) [rhq-enterprise-server-ejb3.jar:4.8.0-SNAPSHOT]
>>          at org.rhq.enterprise.server.resource.metadata.MeasurementMetadataManagerBean$1.execute(MeasurementMetadataManagerBean.java:224) [rhq-enterprise-server-ejb3.jar:4.8.0-SNAPSHOT]
>>          at org.rhq.enterprise.server.util.CriteriaQuery$QueryResultsIterator.next(CriteriaQuery.java:152) [rhq-enterprise-server-ejb3.jar:4.8.0-SNAPSHOT]
>>          at org.rhq.enterprise.server.resource.metadata.MeasurementMetadataManagerBean.deleteMetadata(MeasurementMetadataManagerBean.java:241) [rhq-enterprise-server-ejb3.jar:4.8.0-SNAPSHOT]
>>
>>
>> This happened after starting a newly built dev-container and then deleting several plugins. I do not think that this is specific to the ResourceTypesJob. Can someone who is running a master build check this out? I think the bug is in master as well.
>>
>> - John
>> _______________________________________________
>> rhq-devel mailing list
>> rhq-devel at lists.fedorahosted.org
>> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel



More information about the rhq-devel mailing list