aspose file tools
The moose likes Object Relational Mapping and the fly likes alias not found when trying to set lockmode to NONE Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "alias not found when trying to set lockmode to NONE" Watch "alias not found when trying to set lockmode to NONE" New topic
Author

alias not found when trying to set lockmode to NONE

Sameer Khandekar
Greenhorn

Joined: May 30, 2007
Posts: 1
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.
 
IntelliJ Java IDE
 
subject: alias not found when trying to set lockmode to NONE
 
Threads others viewed
How to select child object without his parent
Problem with hibernate
insert data into 2 tables using HQL
J2C Authentication Data
Unable to use @NamedQuery in a session bean?
IntelliJ Java IDE