You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Bryan Lewis <br...@maine.rr.com> on 2006/04/14 19:11:05 UTC

small problem in 1.2B1 on Oracle 8i

I noticed this line in my log:

    [QueryLogger] === updated -2 rows.

Note the minus sign.

I suspected the recently modified code in BatchAction.runAsBatch() was
running into an Oracle 8i flakiness.  I put a couple of println's in
that method and got this for a single-row update:

 [QueryLogger] UPDATE EMPLOYEE SET MIDDLEINITIAL = ? WHERE EMPLOYEE_ID = ?
 [QueryLogger] [batch bind: 'J', 312]
 [STDOUT] >> results[0] = -2
 [STDOUT] >> totalUpdateCount = -2
 [QueryLogger] === updated -2 rows.

When I do the same on Postgres I get the expected "1 row".


Re: small problem in 1.2B1 on Oracle 8i

Posted by Cris Daniluk <cr...@gmail.com>.
I actually noticed in M11 that I was getting some negative counts - though I
don't think they were all -2

That was both Oracle 9i and 10g. I will pay closer attention with b2. I
think the JIRA you are thinking about specifically was about negative counts
due to the new QueryActions.

Cris

On 4/15/06, Andrus Adamchik <an...@objectstyle.org> wrote:
>
>
> On Apr 15, 2006, at 10:19 PM, Bryan Lewis wrote:
>
> > Just out of curiosity, what was wrong with the old code for getting
> > the
> > count?
> >
> >     QueryLogger.logUpdateCount(statement.getUpdateCount());
>
> Don't remember now - probably didn't work with batch updates. IIRC
> there is a closed JIRA issue that should have the details.
>
> Andrus
>
>

Re: small problem in 1.2B1 on Oracle 8i

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Apr 15, 2006, at 10:19 PM, Bryan Lewis wrote:

> Just out of curiosity, what was wrong with the old code for getting  
> the
> count?
>
>     QueryLogger.logUpdateCount(statement.getUpdateCount());

Don't remember now - probably didn't work with batch updates. IIRC  
there is a closed JIRA issue that should have the details.

Andrus


Re: small problem in 1.2B1 on Oracle 8i

Posted by Bryan Lewis <br...@maine.rr.com>.
Thanks.

Just out of curiosity, what was wrong with the old code for getting the
count?

    QueryLogger.logUpdateCount(statement.getUpdateCount());



Andrus Adamchik wrote:

> "-2" is a constant value defined in JDBC spec 
> (Statement.SUCCESS_NO_INFO). It is returned from the batch update 
> when the driver doesn't know how many rows where updated. The latest 
> change in the batch action enabled logging of this value as a part of 
> the total count. I just changed the logging code to output something 
> like this instead for the negative values:
>
>  === updated ? rows
>
> Andrus
>
>
> On Apr 14, 2006, at 9:14 PM, Mike Kienenberger wrote:
>
>> On 4/14/06, Bryan Lewis <br...@maine.rr.com> wrote:
>>
>>> I noticed this line in my log:
>>>
>>>     [QueryLogger] === updated -2 rows.
>>>
>>> Note the minus sign.
>>>
>>> I suspected the recently modified code in BatchAction.runAsBatch()  was
>>> running into an Oracle 8i flakiness.  I put a couple of println's in
>>> that method and got this for a single-row update:
>>
>>
>> I noticed the same thing.   But I'm using Oracle 9i.  Parts of it
>> might even 10g now.  So I think it's specific to Oracle, but not any
>> particular version.
>>
>> Also, Bryan, please update your mailing list address to
>> cayenne-user@incubator.apache.org
>>
>


Re: small problem in 1.2B1 on Oracle 8i

Posted by Andrus Adamchik <an...@objectstyle.org>.
"-2" is a constant value defined in JDBC spec  
(Statement.SUCCESS_NO_INFO). It is returned from the batch update  
when the driver doesn't know how many rows where updated. The latest  
change in the batch action enabled logging of this value as a part of  
the total count. I just changed the logging code to output something  
like this instead for the negative values:

  === updated ? rows

Andrus


On Apr 14, 2006, at 9:14 PM, Mike Kienenberger wrote:

> On 4/14/06, Bryan Lewis <br...@maine.rr.com> wrote:
>> I noticed this line in my log:
>>
>>     [QueryLogger] === updated -2 rows.
>>
>> Note the minus sign.
>>
>> I suspected the recently modified code in BatchAction.runAsBatch()  
>> was
>> running into an Oracle 8i flakiness.  I put a couple of println's in
>> that method and got this for a single-row update:
>
> I noticed the same thing.   But I'm using Oracle 9i.  Parts of it
> might even 10g now.  So I think it's specific to Oracle, but not any
> particular version.
>
> Also, Bryan, please update your mailing list address to
> cayenne-user@incubator.apache.org
>


Re: small problem in 1.2B1 on Oracle 8i

Posted by Mike Kienenberger <mk...@gmail.com>.
On 4/14/06, Bryan Lewis <br...@maine.rr.com> wrote:
> I noticed this line in my log:
>
>     [QueryLogger] === updated -2 rows.
>
> Note the minus sign.
>
> I suspected the recently modified code in BatchAction.runAsBatch() was
> running into an Oracle 8i flakiness.  I put a couple of println's in
> that method and got this for a single-row update:

I noticed the same thing.   But I'm using Oracle 9i.  Parts of it
might even 10g now.  So I think it's specific to Oracle, but not any
particular version.

Also, Bryan, please update your mailing list address to
cayenne-user@incubator.apache.org