Re: BLOB performance test FYI

From: Anders Bengtsson <ndrsbngtssn(at)yahoo(dot)se>
To: Marin Dimitrov <marin(dot)dimitrov(at)sirma(dot)bg>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: BLOB performance test FYI
Date: 2002-04-18 12:59:55
Message-ID: 1019134798.1814.33.camel@spinoza
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 2002-04-18 Marin Dimitrov wrote:

> > It would imply a change in semantics of a PreparedStatement, that it
> > could only be executed one time once the parameters are set. But I
> > wouldn't be surprised if that is what the JDBC spec. says anyway.
> >
>
> doesn't seem so , it says:
>
> "The values set for the parameter markers of a PreparedStatement object are
> not
> reset when it is executed. The method clearParameters can be called to
> explictly
> clear the values that have been set. Setting a parameter with a different
> value will
> replace the previous value with the new one."
>
> ...which IMHO implies multiple executions with the same parameters should be
> possible

This is really strange. I haven't managed to find anything about this
issue anywhere when searching for JDBC.
I now took a quick look at some other JDBC drivers. It seems MySQL's
driver stores streams, but converts them to byte arrays at execution
time. But it would fail on the second attempt to use a stream parameter.
FireBird seems to have a nicer protocol for large objects, but it
doesn't seem to support re-using a stream either.

The JDBC 2.0 Specification has this clarification:

"When an application passes a stream as an input value via a setXXX() or
updateXXX() method, the application is responsible for maintaining the
stream in a readable state until one of the following methods is called:
PreparedStatement.execute(), executeQuery(), executeUpdate(), or
executeBatch(), and ResultSet.insertRow() or updateRow(). A JDBC driver
is not required to wait until one of these methods is called to read the
stream value."

This sort of implies streaming directly, but for a clarification it
doesn't make things much clearer. :)

/Anders
--

A n d e r s B e n g t s s o n | ndrsbngtssn(at)yahoo(dot)se
Stockholm, Sweden |

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2002-04-18 15:36:40 Re: BLOB performance test FYI
Previous Message Marin Dimitrov 2002-04-18 11:25:12 Re: BLOB performance test FYI