openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afsaneh <>
Subject Re: cast exception for dataCache.QueryKey in glassfish
Date Tue, 03 May 2011 09:36:37 GMT
Hi Rick,
I just set the properties as the below in persistence.xml and no more else:
<property name="openjpa.DataCache" value="true(CacheSize=30000)" /> 
  <property name="openjpa.RemoteCommitProvider" value="sjvm" /> 

Also when my application is initializing, I'm trying to pin some named
queries with the following code in a servlet:
        // looking up to find entityManagerFactory from glassfish
        InvocationManager invMgr =
        ComponentInvocation inv = invMgr.getCurrentInvocation();
        EntityManagerFactory emf = null;
        if (inv != null) {
             Object descriptor =
             emf =
            		 PERSISTENCE_UNIT_NAME, descriptor);

        OpenJPAEntityManagerFactory ojemf =
        QueryResultCache queryResultCache= ojemf.getQueryResultCache();

	EntityManager entityManager =emf.createEntityManager();
	for(String queryName: namedQueries){
	        Query query = entityManager.createNamedQuery(queryName);;	

Thanks for your attention,

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message