db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: org.apache.ojb.broker.accesslayer.RsIterator: absolute(0)
Date Sat, 12 Nov 2005 19:10:20 GMT
hi gao jun,

you're right, absolute(0) is not defined.
so your fix looks ok to me.

thanks for your contribution
jakob

Gao Jun schrieb:
> Hi guys,
> 
> I’m using ojb 1.0.2 with oracle 9.2.
> 
>  
> 
> When I use ReportQueryByCriteria with setStartAtIndex and setEndAtIndex,
> 
> I found when I set the startAtIndex to 1, an ORA-17068 exception throws 
> at JDBC level.
> 
> (invalid argument caused by absolute(0))
> 
>  
> 
> The startAtIndex of 1 is decreased by 1 at PagingIterator.init() and 
> passed to RsIterator.absolute(int row), so RsIterator.absolute(0) is called.
> 
>  
> 
> After study the ojb source, I have one question regarding the method 
> RsIterator.absolute(int row) (org.apache.ojb.broker.accesslayer.RsIterator)
> 
>  
> 
> this line:
> 
> retval = getRsAndStmt().m_rs.absolute(row);
> 
>  
> 
> I add a checking to prevent absolute(0) happens (when 
> query.setStartAtIndex(1)). As below:
> 
> if(row != 0) {
> 
>       retval = getRsAndStmt().m_rs.absolute(row);
> 
> }
> 
>  
> 
>      
> 
> Is my way correct?
> 
> Please advice. Thanks,
> 
>  
> 
> Regards,
> 
> Gao Jun
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message