Multi insert statement and getUpdateCount().

From: Jeremy Whiting <jwhiting(at)redhat(dot)com>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Multi insert statement and getUpdateCount().
Date: 2015-03-26 16:33:29
Message-ID: 551434D9.6040906@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,
I have been testing the current version of pgjdbc master branch. I
added a test case to a branch in my repo [1] to check the behaviour when
a multi insert statement adds two rows to a table. I found the return
value when calling .getUpdateCount() does not equal the number of rows
affected.

My question is what should the return value for .getUpdateCount()
represent. Is it the number of statements executed or rows put in the
database ?

Regards,
Jeremy

[1]
https://github.com/whitingjr/pgjdbc/tree/updatecount-mismatches-updatecount

--
Jeremy Whiting
Senior Software Engineer, JBoss Performance Team
Red Hat

------------------------------------------------------------
Registered Address: RED HAT UK LIMITED, 64 Baker Street, 4th Floor, Paddington. London. United Kingdom W1U 7DF
Registered in UK and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (US), Charles Peters (US), Matt Parson (US) and Michael O'Neill(Ireland)

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message dmp 2015-03-26 19:41:22 Re: Multi insert statement and getUpdateCount().
Previous Message Jeremy Whiting 2015-03-25 19:34:32 Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter)