Home > Archive > PostgreSQL Discussion > April 2005 > Re: SQLException "Connection is closed. Operation is not









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: SQLException "Connection is closed. Operation is not
Ragnar Hafstaš

2005-04-25, 7:23 am

On Mon, 2005-04-25 at 03:38 +0530, Rajiv Verma wrote:
> I'm accessing postgres database through tomcat 4.3.1.
> I'm able to execute the select and update query through my application
> but Insert query is giving following SQLException :
> Connection is closed. Operation is not permitted.


looks like your application is closing the database
connection before the insert.

are you doing the insert within the same tomcat
request as the selects ?

con you reproduce this using the simplest possible
test case. i.e:
have your doPost() only
a) open db connection
b) perform select
c) perform insert
d) close db connection
e) return ok page

gnari



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

Clifton Zama

2005-04-25, 7:23 am

On Monday 25 April 2005 10:54, you wrote:
> On Mon, 2005-04-25 at 03:38 +0530, Rajiv Verma wrote:
>
> looks like your application is closing the database
> connection before the insert.
>
> are you doing the insert within the same tomcat
> request as the selects ?
>
> con you reproduce this using the simplest possible
> test case. i.e:
> have your doPost() only
> a) open db connection
> b) perform select
> c) perform insert
> d) close db connection
> e) return ok page
>
> gnari


I am having a similar problem from a stand-alone application.The log says
something about an unexpected EOF , so I thought maybe it was the program
closing the connection.But this is not the case because it closes while
iterating through a result set.It reads the first one , then when rs.next()
is called again , it says : Connection is closed. Operation is not
permitted.

Clifton

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com