Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 780561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:05:35+00:00 2026-05-14T20:05:35+00:00

Is ResultSet Thread safe? My question arises because in my program i have used

  • 0

Is ResultSet Thread safe?

My question arises because in my program i have used different statement for each query i have declared a ResultSet as an local variable but it gives me a error of Operation not allowed after ResultSet is closed. But my statements are working as i’m using the statements in insert and delete query.I have commented the ResultSet part and have not got the error !!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:05:35+00:00Added an answer on May 14, 2026 at 8:05 pm

    The real problem is that you are sharing Statement objects between multiple threads. Each time you “execute” a Statement, the previously returned ResultSet is automatically closed. In this case, the ResultSet objects “belong” to a different thread which may not yet have finished using it. Hence the exception …

    You should not share Connection, Statement / PreparedStatement or ResultSet objects between multiple threads. Each thread should acquire and release its own resources.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to limit resultset in size without having to change each SQL statement
I have a ResultSet object containing all the rows returned from an sql query.
I have some parallel Fortran90 code in which each thread needs to generate the
i have this thread: public void run() { try { while(isThereActivityRunning()) { results =
i have resultset object and it containing some country names. e.g. rs={India, Japan, USA,
The prepared query returns the following resultset, when $this->show is set to saved-by-the-bell :
I have a C++ singleton that runs as a separate thread. This singleton is
I need to know, whether the Hibernate's session is thread safe or not. But
Background I am assuming the following code is completely thread safe: // Called from
What's the best way to wrap non-thread-safe code in the .net framework? I've got

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.