Re: OpenJPA error with NamedNativeQuery

2007-03-13 Thread Marc Prud'hommeaux
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:

Re: OpenJPA error with NamedNativeQuery

2007-03-13 Thread Mitesh Meswani
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

Re: OpenJPA error with NamedNativeQuery

2007-03-13 Thread Marc Prud'hommeaux
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"

Re: OpenJPA error with NamedNativeQuery

2007-03-13 Thread Marc Prud'hommeaux
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