Skip site navigation (1) Skip section navigation (2)

Re: executeBatch() issue with new driver?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Alan Stange <stange(at)rentec(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: executeBatch() issue with new driver?
Date: 2004-11-02 19:39:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

On Tue, 2 Nov 2004, Alan Stange wrote:

> >This is something (as discussed with Dave) that you shouldn't be doing, 
> >
> Let me be devils advocate for a second and ask "why not"?   I don't 
> disagree,  but I'm not sure I understand all the issues here.

The real problem is that executeBatch() returns an int[] of update counts.  
What should we return for an entry like addBatch("INSERT ... ; INSERT 
..."); ?  Two individual entries? The sum of the update counts?  The 
javadoc for executeBatch isn't entirely clear, but certainly seems to make 
the assumption that one batch entry is one command.  Especially since you 
are already using addBatch, there doesn't seem to be much point in jamming 
two commands into one batch.

Kris Jurka

In response to


pgsql-jdbc by date

Next:From: Oliver JowettDate: 2004-11-02 19:45:43
Subject: Re: ps.setCharacterStream() and memory usage
Previous:From: Kris JurkaDate: 2004-11-02 19:13:00
Subject: Re: executeBatch() issue with new driver?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group