On Wed, 2 Apr 2008, Albe Laurenz wrote:
> If I understood correctly then there *is* a result set in the case mentioned.
> Would it work as desired if the two checks in getUpdateCount were reversed?
> if (result.getResultSet() != null)
> return -1;
> if (isFunction)
> return 1;
Reading some more, the whole "if (isFunction)" line is bogus. I was
thinking that the current situation was that all function calls returned
an update count of 1, but that's not true. If you look at the code in
AbstractJdbc2Statement.executeWithFlags(int) you can see that if someone
has registered an output parameter (returnTypeSet), then it extracts the
results out of the underlying ResultSet and discards it (sets it to null).
So when getUpdateCount is called, the first result == null check is hit so
we return -1.
So right now the only case we're returning 1 is when we actually do have a
ResultSet which is exactly the opposite of what we want. I've applied the
attached patch to CVS and backpatched to 8.0.
In response to
pgsql-jdbc by date
|Next:||From: Craig Ringer||Date: 2008-04-02 17:08:51|
|Subject: Hibernate / other ORM and pg_advisory_lock|
|Previous:||From: Shavonne Marietta Wijesinghe||Date: 2008-04-02 09:40:35|
|Subject: Re: JSP to PostgreSql|