[Pljava-dev] retaining prepared statements across stored procedure calls

From: johann at 2ndquadrant(dot)com (Johann 'Myrkraverk' Oskarsson)
To:
Subject: [Pljava-dev] retaining prepared statements across stored procedure calls
Date: 2011-04-15 23:25:49
Message-ID: op.vtz51bbduxs6vk@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev


>> 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/

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Johann 'Myrkraverk' Oskarsson 2011-04-15 23:31:40 [Pljava-dev] Problem with PLJava on production machine
Previous Message Johann 'Myrkraverk' Oskarsson 2011-04-15 23:21:07 [Pljava-dev] More of Windows Binaries