Mitesh-
Good catch! You're right: it should be "createNamedQuery", not
"createNativeQuery".
As it stands, the query will just try executing the string
"quoteForUpdate" as SQL, which is why we interpret it as a non-select
statement.
On Mar 13, 2007, at 11:22 AM, Mitesh Meswani wrote:
Hi John,
> EJB method calling is this:
> public Quoteejb testForUpdateQuery(String symbol){
> Query q = em.createNativeQuery("quoteForUpdate");
> q.setParameter(1,symbol);
Shouldn't you call Query q = em.createNativeNamedQuery("quoteForUpdate");
?
Regards,
Mitesh
Marc Prud'hommeaux wro
John-
I just ran a test with a named native query that did a "select ...
for update" and it worked fine.
One possibility is that our identification of whether the native
query is a select or an update is done by some fairly simplistic
parsing of whether the statement starts with "select"
I am fairly certain that the only way OpenJPA will ever think that a
native (i.e., SQL) query is not a select query is if it doesn't start
with "select".
Is it possible that you didn't recompile the class after
experimenting with the "quoteForUpdate" @NamedNativeQuery? At some
point in
Hi,
John is having some problems with posting to the open-jpa-dev mailing list
via his e-mail account, so I am posting this message for him so that we can
start this conversation...
=
Fellow OpenJPAers, :)
As Craig had brought up (through Scott Oa