users@glassfish.java.net

Re: RE: EJB Transaction error with Named queries

From: <glassfish_at_javadesktop.org>
Date: Wed, 22 Aug 2007 12:12:40 PDT

Hello Glen,

Looking over the two ways of executing the query, I think you have a bug. Using the named query (and defining it through annotations) causes TLE to use a ResultSetMappingQuery. For some reason the query is told it is using locking, which means it then needs to ensure it is in a transaction causing the exception. If you are already in a transaction, it won't try to start one so there won't be a problem.

If you create the query directly using the createNativeQuery method, TLE uses a ReadAllQuery - please file a bug with a test case so someone can figure out why the ResultSetMappingQuery is starting a transaction when ReadAllQuery isn't.

Best Regards,
Chris
[Message sent by forum member 'chris_delahunt' (chris_delahunt)]

http://forums.java.net/jive/thread.jspa?messageID=232108