Scott

Forgot to mention. That I originally had the iter.next() inside the
transaction like this:

xaction = TransactionUtil.begin();
        iter.next() <---- fails on the second pass through with the ResultSet
closed
        do some work
TransactionUtil.commit();

Skip

-----Original Message-----
From: Scott Gray [mailto:[EMAIL PROTECTED]
Sent: Friday, April 18, 2008 2:25 AM
To: [email protected]
Subject: Re: Help with odd error


Shouldn't the iteration be part of the transaction?  Perhaps derby closes
the result set after TransactionUtil.commit()? The error message mentions
turning autocommit off, which suggests that premature committing might be
the problem.

Regards
Scott

On 18/04/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I have this code:
> ...
>             TransactionUtil.begin();
>             System.out.println("*************************Creating the list
> iterator");
>                 iter = delegator.findListIteratorByCondition("ItemsSold",
> conditionList, null, UtilMisc.toList("productId", "facilityId"));
>             System.out.println("Creating the list iterator finished");
>             TransactionUtil.commit();
>
> ...
>        if(iter != null)
>
> System.out.println("*************************Calling
> Next");
>                                 iItemSold = (GenericValue)iter.next();
>                            System.out.println("Calling Next returns
> product " +
> itemSold.getString("productId"));
>
>
> I am getting this error:
> java.sql.SQLException: ResultSet not open. Operation 'next' not permitted.
> Verify that autocommit is OFF.
>
> at EntityListIterator.next() line 289 which just calls resultSet.next();
>
> This is with derby.  I have just moved back to a development
> machine.  This
> runs fine on Postgres and I swear it used to work fine on derby.
>
> The debug trace code shows that the iterator gets opened and it fails on
> the
> first call to iter.next();  The only code around the elipses are a catch
> block, no db access of any sort.
>
> Anyone have a clue?
>
> Skip
>
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.22.13/1377 - Release Date:
> 4/14/2008
> 9:26 AM
>
>

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.13/1377 - Release Date: 4/14/2008
9:26 AM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.13/1377 - Release Date: 4/14/2008
9:26 AM

Reply via email to