Re: "nested transaction" - encosing statement gets closed - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: "nested transaction" - encosing statement gets closed
Date
Msg-id Pine.BSO.4.64.0701151227070.12242@leary2.csoft.net
Whole thread Raw
In response to "nested transaction" - encosing statement gets closed when the enclosed statement is closed  (Havard Tveite <havard.tveite@umb.no>)
Responses Re: "nested transaction" - encosing statement gets closed
List pgsql-jdbc

On Mon, 15 Jan 2007, Havard Tveite wrote:

> I have experienced problems using the JDBC type 2 and type 3
> drivers for 8.1 (postgresql-8.1-408.jdbc3.jar,
> postgresql-8.1-408.jdbc2.jar) against PostgreSQL 8.1.5.
>

Are you sure it's complaining that stmt is closed.  This coding clearly
looks like the problem will be with stmtchk as you close it in the loop,
but then continue using it.

>  Statement stmtchk = conn.createStatement();
>  while (rs.next()) {
>    ResultSet rsch = stmtchk.executeQuery(checkquery);
>    stmtchk.close(); // leads to the closing of stmt!!!
>  }
>

Kris Jurka

pgsql-jdbc by date:

Previous
From: Havard Tveite
Date:
Subject: "nested transaction" - encosing statement gets closed when the enclosed statement is closed
Next
From: "Jeanna Geier"
Date:
Subject: Re: Problem Retrieving/Refresing Data From Database