• 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

alias not found when trying to set lockmode to NONE

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following code to make sure that the query does not acquire an exclusive lock on the database tables.

query=session.createQuery("select count(*) from prh a " +
" where a.prn = :form_nbr " +
" and UPPER(a.gsi) = thr");
query.setLong("form_nbr",form_nbr);
query.setString("othr","OTHR");
query.setLockMode("a",LockMode.NONE);
The code compiles and builds fine, but when I run it, it throws the following exception:

exception: alias a not found

I am adding the LockMode.None to the query to avoid any kind of table locking as there is some other transaction that is expected to update the same row.

Any help in this regard with be greatly appreciated.
 
Straws are for suckers. Now suck on this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic