Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

code being blocked by ResultSet.execute

 
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
guys,
have you had your code being blocked by a call to ResultSet.execute(sql)?? some times, when someone is locking some resource in the data base and I try to use the same resource the Data base puts my request in a stack to wait unitl some one releases the resource, and my application gets unaccesible?
Any sugestions to solve the problem?
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What database? What kind of statement? Some elementary information might help in thinking up a solution.
Please try again,
Rudy.
 
author & internet detective
Posts: 41184
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Leandro,
I think you answered your own question. Usually this happens when another process has a lock on a table. Make sure to close all your statements/connections to avoid programs causing this error.
Sometimes the problem occurs when you are looking at a table using an interactive tool and the tool crashes. In this case, you have to restart the database.
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My application creates many connectiosn/statements and closes all of them. The problem is that there are other workers working directly with our ORACLE database (with SQL NAVIGATOR). And these users some times don't commit their transactions, and the sistem gets itself down, not responding to requests which need data base access... All I wanted is a way to notify the application user that there is another user working with that data and, tell him to try later.
 
Rudy Dakota
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if that 's what you want, that is mostly information you can get from the system tables. How to go about that exactly , that 's another story. Highly product specific, and so.
So, once again: what RDBMS are you using?
Good riddance,
Rudy.
 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could execute the quesry in a seperate Thread, and after a given amount of time, call the cancel() method on the statement object (the original Thread would have to have a reference to it. All in all it's simple, but not for a beginning JDBC or Thread programmer.
You's also want to make this a pattern in your development, and implement it in a generic way - so it's not a simple solution.
I think that the bigger problem is people having direct access to run these types of locking queries on the database!
 
reply
    Bookmark Topic Watch Topic
  • New Topic