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: PagingIterator: not really a scrollcursor!
Date Wed, 17 Dec 2003 20:23:15 GMT
hi armin, thierry,

there's another problem with relative and absolute in OJBIterator:

     boolean absolute(int row) throws PersistenceBrokerException;

     boolean relative(int row) throws SQLException;

why does relative throw an SqlException ?

jakob

Armin Waibel wrote:

> Hi again,
> 
> Jakob Braeuchi wrote:
> 
>> hi armin,
>>
>> afaik all iterators returned by pb are OJBIterators, so is the 
>> PagingIterator. and with a little help of a typecast...
> 
> 
> ok, that's what I mean. OJB couldn't know of that typecast and close the 
> resources if possible. We could introduce a flag to allow bypass of the 
> auto-resource-cleanup and let the user free resources
> (setAutoRelease(false) or something similar).
> 
> regards,
> Armin
> 
>>
>> thierry, the patch you mentioned is not attached, please send it to my 
>> mail address.
>>
>> jakob
>>
>> Armin Waibel wrote:
>>
>>> Hi Thierry and Jakob,
>>>
>>> I changed RsIterator to be very strict in resource 
>>> (Statement/ResultSet) handling. To avoid abandoned 
>>> Statement/ResultSet instances we have to close resources as soon as 
>>> possible.
>>>
>>>  >> Second            è in PagingIterator, when you call next for the

>>> last
>>>  >> record, the rsIterator call releaseDbResources  and mark result 
>>> to close.
>>>  >>                         After this, if you call absolute or 
>>> relative,
>>>  >> you have this error
>>>
>>> What I don't understand, how can you call 'absolute' method, Iterator 
>>> interface does not support this method (PB-api only returns Iterator 
>>> instances, or I'm wrong?).
>>>
>>> regards,
>>> Armin
>>>
>>> Jakob Braeuchi wrote:
>>>
>>>> hi thierry,
>>>>
>>>> you're right, this is a problem. i'll check the cursor-position asap.
>>>> but i'm not sure about calling releaseDbResources.
>>>>
>>>> Thierry Legrain wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>>  
>>>>>
>>>>> I have a big problem with PagingIterator. This is a big 
>>>>> show-stopper for me.
>>>>>
>>>>> I really appreciate in RC5 the new PagingIterator (I need to use 
>>>>> scrollcursor since RC4) but your implementation has some problems.
>>>>>
>>>>>  
>>>>>
>>>>> First                è in PagingIterator, when I use absolute or 
>>>>> relative, you don't resync m_currentCursorPosition
>>>>>
>>>>>                         and hasNext() call releaseDbResources. It' 
>>>>> not the good solution, releaseDbResources  is in charge of 
>>>>> developer (see correction attachment file).
>>>>>
>>>>>  
>>>>>
>>>>> Second            è in PagingIterator, when you call next for the 
>>>>> last record, the rsIterator call releaseDbResources  and mark 
>>>>> result to close.
>>>>>
>>>>>                         After this, if you call absolute or 
>>>>> relative, you have this error
>>>>>
>>>>> java.util.NoSuchElementException: inner hasNext was false
>>>>>
>>>>>                         And you lose all benefits of scrollcursor.
>>>>>
>>>>>  
>>>>>
>>>>> Thanks Much,
>>>>>
>>>>> Thierry Legrain.
>>>>>
>>>>>  
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------

>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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