db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: PreparedStatement Persistance
Date Wed, 05 Apr 2006 17:31:34 GMT
Daniel Morton wrote:
> Over the past few threads, someone mentioned that the
> PreparedStatements are cached on the database even
> when the connection that created the
> PreparedStatements are closd... I was discussing that
> very issue with an associate of mine a couple of weeks
> ago, and he assured me that the Oracle and DB2 people
> he knew told him that the PreparedStatements did not
> persist between connections.  Is that incorrect, or
> does Derby just handle it differently?

PreparedStatements are not cached in Derby, however the compiled plan of
the statement is cached across connections, and can be shared across
connections. It is this compiled plan that takes the significant amount
of time to create.

PreparedStatements are really a wrapper around the compiled plan that
maintans state specific to that statement and connection.

Most databases have this ability to cache the compiled plan, to avoid
re-compilation across connections.

Dan.


Mime
View raw message