You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Jakob Braeuchi <jb...@gmx.ch> on 2003/05/01 23:34:35 UTC

query startIndex without endIndex

hi all,

imo we have a problem (at least i have it with mysql) when using 
setStartIndex withou setEndIndex. in this case the endIndex is null 
which leads to a npe in mysql-driver.

i could solve this problem with the following simple patch in 
PersistenceBrokerImpl#getCollectionByQuery
after line 1315

...
            if (endAt < startAt)
            {
                // BRJ : make sure endAt > startAt
                endAt = iter.size();
            }
...          

i'm not sure about any side-effects of this patch, so i ask the gurus to 
have a closer look.

jakob


Re: query startIndex without endIndex

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi jacob,

could you please send me the whole class, the attachment is useless.

jakob

Jacob Hookom wrote:

>I had a similar problem, attached is a solution I did up for the
>SqlGenerator.
>
>| -----Original Message-----
>| From: Jakob Braeuchi [mailto:jbraeuchi@gmx.ch]
>| Sent: Thursday, May 01, 2003 4:35 PM
>| To: OJB Developers List
>| Subject: query startIndex without endIndex
>| 
>| hi all,
>| 
>| imo we have a problem (at least i have it with mysql) when using
>| setStartIndex withou setEndIndex. in this case the endIndex is null
>| which leads to a npe in mysql-driver.
>| 
>| i could solve this problem with the following simple patch in
>| PersistenceBrokerImpl#getCollectionByQuery
>| after line 1315
>| 
>| ...
>|             if (endAt < startAt)
>|             {
>|                 // BRJ : make sure endAt > startAt
>|                 endAt = iter.size();
>|             }
>| ...
>| 
>| i'm not sure about any side-effects of this patch, so i ask the gurus to
>| have a closer look.
>| 
>| jakob
>| 
>| 
>| ---------------------------------------------------------------------
>| To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>| For additional commands, e-mail: ojb-dev-help@db.apache.org
>| 
>| ---
>| Incoming mail is certified Virus Free.
>| Checked by AVG anti-virus system (http://www.grisoft.com).
>| Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/2003
>| 
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/2003
> 
>  
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>


RE: query startIndex without endIndex

Posted by Jacob Hookom <ho...@uwec.edu>.
I had a similar problem, attached is a solution I did up for the
SqlGenerator.

| -----Original Message-----
| From: Jakob Braeuchi [mailto:jbraeuchi@gmx.ch]
| Sent: Thursday, May 01, 2003 4:35 PM
| To: OJB Developers List
| Subject: query startIndex without endIndex
| 
| hi all,
| 
| imo we have a problem (at least i have it with mysql) when using
| setStartIndex withou setEndIndex. in this case the endIndex is null
| which leads to a npe in mysql-driver.
| 
| i could solve this problem with the following simple patch in
| PersistenceBrokerImpl#getCollectionByQuery
| after line 1315
| 
| ...
|             if (endAt < startAt)
|             {
|                 // BRJ : make sure endAt > startAt
|                 endAt = iter.size();
|             }
| ...
| 
| i'm not sure about any side-effects of this patch, so i ask the gurus to
| have a closer look.
| 
| jakob
| 
| 
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
| For additional commands, e-mail: ojb-dev-help@db.apache.org
| 
| ---
| Incoming mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/2003
| 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/2003