Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] jpa_helper_invalid_queryclass $Proxy34

I think I understand, Spring is in play here and I'm pretty sure it's
the one creating the proxy instances.....

Thanks..



On Fri, May 28, 2010 at 2:13 PM, Christopher Delahunt
<christopher.delahunt@xxxxxxxxxx> wrote:
> I'm sorry, I'm not sure I follow you.  How are you getting proxy objects
> from the EclipseLink entityManager instance instead of JpaQuery instances?
> My understanding is that the em in your case is a proxy wrapping the
> underlying delegate entitymanager, in which case getDelegate will give you a
> handle to the underlying Em.  Where are you running this, and what class
> type is the delegate object returned?
>
> Regards,
> Chris
>
> On 28/05/2010 2:06 PM, Zarar Siddiqi wrote:
>
> It doesn't matter whether you create it using em.createQuery() or
> em.getDelegate().createQuery(), the issue is that the query returned
> is a Proxy object.
>
> Thanks,
> Zarar
>
>
>
> On Fri, May 28, 2010 at 1:58 PM, Christopher Delahunt
> <christopher.delahunt@xxxxxxxxxx> wrote:
>
>
> I'm not sure where you are running this server wise, but you can always get
> the delegate EntityManager and have it create your query directly:
>  Query query = em.getDelegate().createQuery(...);
>  JpaHelper.getDatabaseQuery(query).setRedirector(aggressiveCacheQueryRedirector);
>
> em.getDelegate should give you the EclipseLink em and so not give you a
> proxy query object either.
> Best Regards,
> Chris
>
>
>
> On 28/05/2010 1:43 PM, Zarar Siddiqi wrote:
>
>
> I'm receiving the following error almost randomly, but once I receive
> it, all subsequent calls using the em fail:
>
> jpa_helper_invalid_queryclass $Proxy34 (There is no English
> translation for this message.)
>
> I use the following before each query:
> Query query = em.createQuery(...);
>
> JpaHelper.getDatabaseQuery(query).setRedirector(aggressiveCacheQueryRedirector);
>
> I looked at the code inside JpaHelper.getDatabaseQuery() which is
> where the exception is thrown and it reads:
>
>
>        if (query instanceof JpaQuery) {
>            return ((JpaQuery)query).getDatabaseQuery();
>        }
>
>        throw new
>
> IllegalArgumentException(ExceptionLocalization.buildMessage("jpa_helper_invalid_query"
> + query.getClass()));
>
>
>
> Any idea how to get around the proxy?
>
> Thanks,
> Zarar
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
>
>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>



-- 
Zarar Siddiqi
416-737-9024


Back to the top