• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jdbc FOR UPDATE clause limitation

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy - love your website... I'm having a problem with a jdbc limitation that is pretty common based on researching other posts; however I haven't been able to find a workaround or solution! Perhaps you can point me to a posting that solves this problem or help me directly. It all started out with this from the Oracle JDBC manual:

FOR UPDATE Clause Limitation in an Updatable Result Set
A query cannot have the FOR UPDATE clause in the SELECT statement if you are
using an updatable result set. If you use the FOR UPDATE clause and try to update a
result set, an SQLException will be thrown.

(BTW, the exception is the mysterious "missing parenthesis" message that you know all too well).

I want to lock a row for the duration of a transaction. The only solution I was able to find was to use a positioned update: UPDATE... WHERE CURRENT OF cursor. That would be perfect and is the technique I use in other languages. But that doesn't work because it's not supported by my driver! Now I'm stuck. What I'm doing is very, very normal and common so there must be a solution. Thanks.





reply
    Bookmark Topic Watch Topic
  • New Topic