pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: java connection closing itself
2+ messages / 2 participants
[nested] [flat]
* Re: java connection closing itself
@ 2005-04-12 10:54 Guillaume Cottenceau <gc@mnc.ch>
parent: Clifton Zama <csz@jhb.ucs.co.za>
0 siblings, 0 replies; 2+ messages in thread
From: Guillaume Cottenceau @ 2005-04-12 10:54 UTC (permalink / raw)
To: Clifton Zama <csz@jhb.ucs.co.za>; +Cc: pgsql-jdbc
Clifton Zama <csz 'at' jhb.ucs.co.za> writes:
> Hi
>
> What would cause a connection to automatically close within a
> java program.It gets to a point where I have an inner loop that
> calls a recursive method that creates resultsets.But I am
> closing all my result sets, so I do not know why the connection
> simply closes itself.Please help.
There is a "bug" in which the DB driver tells you that the
connection is closed, although it isn't really closed, in
situations where the data is not available anymore.
Such a situation occurs when a ResultSet has been closed but you
are still trying to extract data from it. A ResultSet can be
closed by calling its close method, but also implicitely when the
Statement object that generated it is closed, re-executed, or is
used to retrieve the next result from a sequence of multiple
results.
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#close()
To make it short: if you're nesting multiple #executeQuery() on a
single Statement object, you're going to have this problem if
your loop goes down the nesting and does subsequent accesses to
the ResultSet.
--
Guillaume Cottenceau
^ permalink raw reply [nested|flat] 2+ messages in thread
* java connection closing itself
@ 2005-04-13 08:26 Clifton Zama <csz@jhb.ucs.co.za>
0 siblings, 1 reply; 2+ messages in thread
From: Clifton Zama @ 2005-04-13 08:26 UTC (permalink / raw)
To: pgsql-jdbc
Hi
What would cause a connection to automatically close within a java program.It
gets to a point where I have an inner loop that calls a recursive method that
creates resultsets.But I am closing all my result sets, so I do not know why
the connection simply closes itself.Please help.
Clifton Zama
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-04-13 08:26 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-13 08:26 java connection closing itself Clifton Zama <csz@jhb.ucs.co.za>
2005-04-12 10:54 ` Guillaume Cottenceau <gc@mnc.ch>
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