Re: JDBC caching plpgsql function errors?

From: "Jim Steinberger" <steinberger(at)dynedge(dot)com>
To: "'Paul Thomas'" <paul(at)tmsl(dot)demon(dot)co(dot)uk>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: JDBC caching plpgsql function errors?
Date: 2004-04-30 18:46:24
Message-ID: 20040430184807.6C71722BC8F@inetsrv07.digitalrealm.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

[snip]
Are you storing anything in session scope which might cause the function
to be cached?

No -- when the SUBMIT button is pressed, a bean is instantiated, the bean's
properties are set based on the HTML form, and then the bean's "insert"
method is called. The "insert" method gets a connection from Tomcat's
connection pool, uses it to create a PreparedStatement, and then uses the
bean's properties to set the PreparedStatement's parameters. It executes
the statement, and finally closes the PreparedStatement and then the
Connection (in a finally { } block) before leaving the method.

So, nothing's being stored in the session -- the bean, PreparedStatement,
and Connection objects are all created and destroyed/closed in the scope of
the request.

However, it is possible that each request is using the same database
connection, since each request closes the connection it used, returning the
connection to Tomcat's connection pool. Even if the connection is the same,
however, the specific PreparedStatement should have gone away when it was
closed, shouldn't it have? And even if it cached the PreparedStatement,
why/how would it be able to cache Postgres's response to it?

So confused,
Jim

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Paul Thomas
Sent: Friday, April 30, 2004 2:01 PM
To: Jim Steinberger
Cc: pgsql-general @ postgresql . org
Subject: Re: [GENERAL] JDBC caching plpgsql function errors?

On 30/04/2004 17:34 Jim Steinberger wrote:
> [snip]
> Anyone have any ideas? I /think/ I worked around this same problem a few
> months ago by restarting the server, but clearly I shouldn't have to do
> that
> every time I modify a function.

Are you storing anything in session scope which might cause the function
to be cached?

--
Paul Thomas
+------------------------------+--------------------------------------------
-+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+--------------------------------------------
-+

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Gamache 2004-04-30 19:36:20 Re: Foreign Key ON DELETE CASCADE Performance
Previous Message Ian Harding 2004-04-30 18:44:28 Re: synchronizing MS access and postgresql tables