Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-08-2008, 03:26 PM
Member
 
Join Date: Apr 2008
Posts: 5
nanimtech is on a distinguished road
Exception : ResultSet is closed
Hi folks
I have a problem while closing the ResultSet in JDBC.
iam using Postgre DB, here for normal execution it is working fine,
but while we are doing load test at the rate of 30 or 40 hits to the
application on a peak volume it is throwing the error like
"PSQLException:This ResultSet is closed."
can you please let me know what are all the possibilities....
here is my DB releasing code..



if (pConnection != null) {
pConnection.close();
pConnection = null;

if (pStatement != null) {
pStatement.close();
pStatement = null;

if(pResultSet != null) {
pResultSet.close();
pResultSet = null;




All these statements are enclosed in try/catch block...


I really appreciate for any thoughts...

--Naresh
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-22-2008, 04:33 AM
Member
 
Join Date: Apr 2008
Posts: 28
rico16135 is on a distinguished road
why are you checking to see if it is null? just close it in a finally clause.

your setting it to null after you close it.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-21-2008, 06:39 PM
Member
 
Join Date: Dec 2007
Posts: 32
felixtfelix is on a distinguished road
hi,

You have to close the objects in the certain order

1. ResultSet
2. PreparedStatement
3. Connection

Regards
Felix T
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-22-2008, 07:32 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 191
danielstoner is on a distinguished road
What line of code throws the exception? Does it happen when you try to use the ResultSet after a query? Can you show the actual code that uses the ResultSet and indicate the problem line?
__________________
Daniel @ [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ResultSet size bugger Database 15 09-18-2008 04:52 PM
Trouble with factory method - unhandled exception type Exception desmond5 New To Java 1 03-08-2008 08:41 PM
ResultSet to XML Java Tip Java Tips 0 02-14-2008 11:50 AM
Empty ResultSet Java Tip Java Tips 0 02-09-2008 10:36 PM
ResultSet example Java Tip Java Tips 0 01-20-2008 10:59 AM


All times are GMT +3. The time now is 02:42 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org