Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Aggregation, potential bug
stevegal
I have a report that may return an empty dataset, and I have aggregation set on that dataset.<br />
In my test framework I've noticed some strange behaviour in 4.2.2, namely that when it gets a result set from a jdbc connection )odiAdapter, it uses a forward lookup Strategy so on the prepare initial row in SimpleResultSet it gets the current Result (which results in an underlying call to the jdbc ResultSet.next() ). It the proceeds to call getNext for the group result. This will always result in a call to jdbc resultset.next() even if the first call has resulted in false.<br />
<br />
In the spec for the this it says that a second call to resultSet.next may throw an error on the second call to next after a return of false. I would therefore expect the BIRT impl to ensure it doesn't do that. That looks to be the intention of what captured in the RowResultSet.getNext() and there is defensive coding in the internal doNext in this area as well, however my question is should the implementation of the method<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
private IResultObject doNext( ) throws DataException
{
if ( finished )
return null;
if ( this.nextResultObject != null )
{
this.lastResultObject = this.nextResultObject;
this.nextResultObject = null;
return this.lastResultObject;
}
if ( currIndex >= maxRows )
return null;
IResultObject odaObject = null;
while ( true )
{
odaObject = fetch( );
if ( odaObject == null )
{
break;
}
else
{
actualIndex++;
if ( !processFetchEvent( odaObject, actualIndex ))
{
continue;
}
if ( this.distinctValueFlag == true
&& isDuplicatedObject( odaObject ) )
{
continue;
}
currIndex++;
break;
}
}
return odaObject;
}
</pre>
<br />
be changed to<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
private IResultObject doNext( ) throws DataException
{
if ( finished )
return null;
if ( this.nextResultObject != null )
{
this.lastResultObject = this.nextResultObject;
this.nextResultObject = null;
return this.lastResultObject;
}
if ( currIndex >= maxRows )
return null;
IResultObject odaObject = null;
while ( true )
{
odaObject = fetch( );
if ( odaObject == null )
{
this.finished=true; // note set the finished flag here as we've run out of results
break;
}
else
{
actualIndex++;
if ( !processFetchEvent( odaObject, actualIndex ))
{
continue;
}
if ( this.distinctValueFlag == true
&& isDuplicatedObject( odaObject ) )
{
continue;
}
currIndex++;
break;
}
}
return odaObject;
}
</pre>
<br />
to prevent the 2 next calls being run on empty datasets?
Find more posts tagged with
Comments
There are no comments yet