Is a query a one time use object? Meaning, I only get to call getResultList(), getSingleResult(), or executeUpdate() once and then I have to get a new instance.

Also you stated:

On Apr 24, 2007, at 10:35 PM, Patrick Linskey wrote:
(please please please make it a dynamic
proxy that implements all the interfaces that the proxied thing
implements).

When I first wrote the proxy, I tried to implement it using a dymanic proxy, but gave up after I discovered the extreme differences in the handling of the methods. Some methods require an active transaction, and some are fine without one, but you have to close the em in a finally block. The getQuery methods, need to have the Query object proxied, but only if there is no transaction. Some methods like joinTransaction(), close(), isOpen(), and getTransaction() just have custom rules.

So I could easily create a dynamic proxy, but which strategy would I choose for the methods that are "dyanmic" (i.e., the extra methods not on the entity manager interface)?

-dain

Reply via email to