agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] [SPAM] Re: Pljava\-dev Digest, Vol 26, Issue 8
Date: Wed, 19 Apr 2006 11:24:54 +0200
Message-ID: <444601E6.2060103@lewczuk.com> (raw)
In-Reply-To: <20060419085728.5BBB4978E7@smtp.263.net>
References: <20060419085728.5BBB4978E7@smtp.263.net>

lifeng napisa?(a):
> pljava-dev-request,hi?
> When did the result close ?  Marek, we can see 
> two ResultSet("result" and "r")in your sourcecode .In the last code , 
>there is "r.close" to close ResultSet("r") explicitly but i cann't see where 
> the "result" is closed . If you did not close the "result", i guess that it's the 
> error to lead the memory leak.

Well, result is a ResultSet of the main query:
		
		Connection connection = 
DriverManager.getConnection("jdbc:default:connection");
		Statement statement = connection.createStatement();
		ResultSet result;
		statement.execute("...");
		result = statement.getResultSet();
		while (result.next()) {
		...
		}
		result.close();
		statement.close();

So as you can see it will be closed after last row.

 




view thread (2+ messages)

Message-ID: <444601E6.2060103@lewczuk.com>
Permalink:  ../444601E6.2060103@lewczuk.com/
Also on:    postgresql.org/message-id/444601E6.2060103@lewczuk.com

reply

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 using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] [SPAM] Re: Pljava\-dev Digest, Vol 26, Issue 8
  In-Reply-To: <444601E6.2060103@lewczuk.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox