Subject: [Pljava-dev] retaining prepared statements across stored procedure calls
Date: Fri, 15 Apr 2011 23:25:49 -0000
Message-ID: <op.vtz51bbduxs6vk@localhost> (raw)
In-Reply-To: <DUB103-w619D7BE5CD6732004A3A11BEA80@phx.gbl>
References: <DUB103-w4058D109F7165ACBB748BCBEA80@phx.gbl>
<4DA36735.4080402@tada.se>
<DUB103-w619D7BE5CD6732004A3A11BEA80@phx.gbl>
>> When
>> I call callProc in psql, I get a warning about closing 1
>> forgotten statement. Does that mean I cannot have prepared
>> statements lingering around after each store procedure
>> invocation?
>>
> Yes it does.
> - thomas
Is there a good reason for this?
Is there something wrong with initializing prepared statements within a
static initializer?
PreparedStatment prep;
static {
//...
prep = connection.prepareStatement( "select 1;" );
//...
}
public static useStatement() {
//...
prep.executeQuery();
//...
}
--
Johann Oskarsson http://www.2ndquadrant.com/ |[]
PostgreSQL Development, 24x7 Support, Training and Services --+--
|
Blog: http://my.opera.com/myrkraverk/blog/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] retaining prepared statements across stored procedure calls
In-Reply-To: <op.vtz51bbduxs6vk@localhost>
References: <DUB103-w4058D109F7165ACBB748BCBEA80@phx.gbl> <4DA36735.4080402@tada.se> <DUB103-w619D7BE5CD6732004A3A11BEA80@phx.gbl> <op.vtz51bbduxs6vk@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox