Re: setUseServerPrepare(true) and executeQuery(String) - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: setUseServerPrepare(true) and executeQuery(String)
Date
Msg-id 3DE9CB98.1000804@xythos.com
Whole thread Raw
In response to setUseServerPrepare(true) and executeQuery(String)  (Harald Krake <harald@krake.de>)
Responses Re: setUseServerPrepare(true) and executeQuery(String)  (Harald Krake <harald@krake.de>)
List pgsql-jdbc
Harald,

Why would you want to disable caching for standard jdbc statements
plans?  In my application these are the ones that get reused the most,
and therefore benefit most from caching the plan on the server.  If you
don't wan't to use a server side prepared and cached plan, then don't
enable it for your regular jdbc statement objects.

thanks,
--Barry

Harald Krake wrote:
> playing with the new server side prepared statements of 7.3 I discovered
> that _all_ statements will be prepared as server objects, not only
> the prepared ones. Depending on the application this might result in
> a permanently increasing number of server objects.
>
> In executeQuery(String), AbstractJdbc1Statement.java:141
> I would suggest the following modification:
>
>     boolean old_useServerPrepare = m_useServerPrepare;
>     m_useServerPrepare = false;     // turn off for non-prepared statements
>     java.sql.ResultSet rs = executeQuery();
>     m_useServerPrepare = old_useServerPrepare;
>     return rs;
>
> regards,
> Harald.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>




pgsql-jdbc by date:

Previous
From: "Felipe Schnack"
Date:
Subject: setDefault()
Next
From: Harald Krake
Date:
Subject: Re: setUseServerPrepare(true) and executeQuery(String)