Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » eclipselink stackoverflow exceptions - repeating same query thousand of time(eclipselink gives stackoverflow exceptions as keeps executing same query thousand of times)
eclipselink stackoverflow exceptions - repeating same query thousand of time [message #1386632] Wed, 18 June 2014 21:13
Ahmad Bahaaeldin is currently offline Ahmad BahaaeldinFriend
Messages: 1
Registered: June 2014
Location: Egypt
Junior Member
We have project that is already deployed on oracle application server 10.2 on many sites, project uses jsf and eclipse link 2.2.0.
however we have problem in a recent installation that eclipse link keeps executing queries with same bind information thousand of times, till application crash and gives stack overflow error.
We use following code to generate object descriptor:
public ClassDescriptor buildTLEntityPCDAODescriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
descriptor.setJavaClass(com.its.tabs.tpc.layers.dal.entity.toplink.TLEntityPCDAO.class);
descriptor.addTableName("TPC_ENTITIES");
descriptor.addPrimaryKeyFieldName("TPC_ENTITIES.ENTITY_ID");

// Inheritance Properties.

// Descriptor Properties.
descriptor.useSoftCacheWeakIdentityMap();
descriptor.setIdentityMapSize(100);
descriptor.useRemoteSoftCacheWeakIdentityMap();
descriptor.setRemoteIdentityMapSize(100);
descriptor.setSequenceNumberFieldName("TPC_ENTITIES.ENTITY_ID");
descriptor.setSequenceNumberName("SEQ_ENTITIES");
descriptor.setAlias("TLEntityPCDAO");

// Cache Invalidation Policy
TimeToLiveCacheInvalidationPolicy policy = new TimeToLiveCacheInvalidationPolicy(1);
policy.setShouldUpdateReadTimeOnUpdate(false);
descriptor.setCacheInvalidationPolicy(policy);

// Query Manager.
descriptor.getQueryManager().checkCacheForDoesExist();

DirectToFieldMapping descriptionMapping = new DirectToFieldMapping();
descriptionMapping.setAttributeName("description");
descriptionMapping.setFieldName("TPC_ENTITIES.DESCRIPTION");
descriptor.addMapping(descriptionMapping);

DirectToFieldMapping serviceProviderCodeMapping = new DirectToFieldMapping();
serviceProviderCodeMapping.setAttributeName("serviceProviderCode");
serviceProviderCodeMapping.setFieldName("TPC_ENTITIES.SERVICE_PROVIDER_CODE");
descriptor.addMapping(serviceProviderCodeMapping);

DirectToFieldMapping entity_idMapping = new DirectToFieldMapping();
entity_idMapping.setAttributeName("entity_id");
entity_idMapping.setNullValue(new Long(0));
entity_idMapping.setFieldName("TPC_ENTITIES.ENTITY_ID");
descriptor.addMapping(entity_idMapping);

DirectToFieldMapping idMapping = new DirectToFieldMapping();
idMapping.setAttributeName("id");
idMapping.readOnly();
idMapping.setFieldName("TPC_ENTITIES.ENTITY_ID");
descriptor.addMapping(idMapping);

DirectToFieldMapping levelIdMapping = new DirectToFieldMapping();
levelIdMapping.setAttributeName("levelId");
levelIdMapping.setNullValue(new Long(0)); //changed from -1 to 0
levelIdMapping.setFieldName("TPC_ENTITIES.LEVEL_ID");
descriptor.addMapping(levelIdMapping);

DirectToFieldMapping lookupIdMapping = new DirectToFieldMapping();
lookupIdMapping.setAttributeName("lookupId");
lookupIdMapping.setNullValue(new Long(0)); //changed from -1 to 0
lookupIdMapping.setFieldName("TPC_ENTITIES.LOOKUP_ID");
descriptor.addMapping(lookupIdMapping);

DirectToFieldMapping levelDepthMapping = new DirectToFieldMapping();
levelDepthMapping.setAttributeName("levelDepth");
levelDepthMapping.setFieldName("TPC_ENTITIES.LEVEL_DEPTH");
descriptor.addMapping(levelDepthMapping);

DirectToFieldMapping entity_sequenceMapping = new DirectToFieldMapping();
entity_sequenceMapping.setAttributeName("entity_sequence");
entity_sequenceMapping.setNullValue(new Long(0));
entity_sequenceMapping.setFieldName("TPC_ENTITIES.ENTITY_SEQUENCE");
descriptor.addMapping(entity_sequenceMapping);

DirectToFieldMapping entity_typeMapping = new DirectToFieldMapping();
entity_typeMapping.setAttributeName("entity_type");
entity_typeMapping.setFieldName("TPC_ENTITIES.ENTITY_TYPE");
descriptor.addMapping(entity_typeMapping);

DirectToFieldMapping nameMapping = new DirectToFieldMapping();
nameMapping.setAttributeName("name");
nameMapping.setFieldName("TPC_ENTITIES.NAME");
descriptor.addMapping(nameMapping);

DirectToFieldMapping parent_entity_idMapping = new DirectToFieldMapping();
parent_entity_idMapping.setAttributeName("parent_entity_id");
parent_entity_idMapping.setNullValue(new Long(0)); //changed from -1 to 0
parent_entity_idMapping.setFieldName("TPC_ENTITIES.PARENT_ENTITY_ID");
descriptor.addMapping(parent_entity_idMapping);

AggregateObjectMapping auditFieldsMapping = new AggregateObjectMapping();
auditFieldsMapping.setAttributeName("auditFields");
auditFieldsMapping.setReferenceClass(com.its.tabs.architecture.dal.persistency.AuditFields.class);
auditFieldsMapping.setIsNullAllowed(false);
auditFieldsMapping.addFieldNameTranslation("TPC_ENTITIES.CREATED_BY", "createdBy->DIRECT");
auditFieldsMapping.addFieldNameTranslation("TPC_ENTITIES.MODIFIED_BY", "modifiedBy->DIRECT");
auditFieldsMapping.addFieldNameTranslation("TPC_ENTITIES.CREATED_DATE", "createdDate->DIRECT");
auditFieldsMapping.addFieldNameTranslation("TPC_ENTITIES.MODIFIED_DATE", "modifiedDate->DIRECT");
descriptor.addMapping(auditFieldsMapping);

OneToManyMapping entitesMapping = new OneToManyMapping();
entitesMapping.setAttributeName("entites");
entitesMapping.setReferenceClass(com.its.tabs.tpc.layers.dal.entity.toplink.TLEntityPCDAO.class);
entitesMapping.useTransparentCollection();
entitesMapping.useCollectionClass(org.eclipse.persistence.indirection.IndirectList.class);
entitesMapping.addTargetForeignKeyFieldName("TPC_ENTITIES.PARENT_ENTITY_ID", "TPC_ENTITIES.ENTITY_ID");
descriptor.addMapping(entitesMapping);

OneToManyMapping entityattributesMapping = new OneToManyMapping();
entityattributesMapping.setAttributeName("entityattributes");
entityattributesMapping.setReferenceClass(com.its.tabs.tpc.layers.dal.entityattributes.toplink.TLEntityAttributesDAO.class);
entityattributesMapping.useTransparentCollection();
entityattributesMapping.useCollectionClass(org.eclipse.persistence.indirection.IndirectList.class);
entityattributesMapping.addTargetForeignKeyFieldName("TPC_ENTITY_ATTRIBUTES.ENTITY_ID", "TPC_ENTITIES.ENTITY_ID");
descriptor.addMapping(entityattributesMapping);

OneToOneMapping entityLevelIdMapping = new OneToOneMapping();
entityLevelIdMapping.setAttributeName("levels");
entityLevelIdMapping.setReferenceClass(TLLevelsDAO.class);
entityLevelIdMapping.useProxyIndirection();
entityLevelIdMapping.readOnly();
entityLevelIdMapping.addForeignKeyFieldName("TPC_ENTITIES.LEVEL_ID", "TPC_LEVELS.LEVEL_ID");
descriptor.addMapping(entityLevelIdMapping);

OneToOneMapping entityLookupIdMapping = new OneToOneMapping();
entityLookupIdMapping.setAttributeName("lookups");
entityLookupIdMapping.setReferenceClass(TLLookupDAO.class);
entityLookupIdMapping.useProxyIndirection();
entityLookupIdMapping.readOnly();
entityLookupIdMapping.addForeignKeyFieldName("TPC_ENTITIES.LOOKUP_ID", "TPC_LOOKUP.LOOKUP_ID");
descriptor.addMapping(entityLookupIdMapping);

return descriptor;
}


code for accessing this object:
public List <EntityPCEntity> findAllEntities() throws DatabaseException {

List<EntityPCEntity> entityList = new ArrayList<EntityPCEntity>();
entityList = (List<EntityPCEntity>)this.getTABSEntityManagerFinder().getEclipseLinkAdapter().readMultipleDAOs(TLEntityPCDAO.class);

return entityList;
}

Exception stack
javax.ejb.EJBException: java.lang.StackOverflowError
at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:317)
at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:67)
at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
at TreeLoaderEJB_LocalProxy_3ggekch.findAllEntities(Unknown Source)
at com.its.tabs.tpc.layers.biz.TPCBusinessDelegate.findAllEntities(TPCBusinessDelegate.java:778)
at com.its.tabs.tpc.web.common.beans.tree.TpcTree.init(TpcTree.java:144)
at com.its.tabs.tpc.web.common.beans.tree.TpcTree.<init>(TpcTree.java:97)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.myfaces.shared_impl.util.ClassUtils.newInstance(ClassUtils.java:277)
at org.apache.myfaces.shared_impl.util.ClassUtils.newInstance(ClassUtils.java:268)
at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:49)
at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:314)
at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:570)
at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:140)
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
at javax.faces.component.UIOutput.getValue(UIOutput.java:80)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:223)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:498)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:366)
at _index._jspService(_index.java:431)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:287)
at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:50)
at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:222)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:619)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:306)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:194)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.StackOverflowError

logs and opmn configurations are attached
appreciate your help as i'm new to eclipse link
Previous Topic:Spring managed transactions, EclipseLink JPA, custom isolation level
Next Topic:OneToOne Mapping Exception
Goto Forum:
  


Current Time: Mon Jul 06 03:14:36 GMT 2015

Powered by FUDForum. Page generated in 0.01573 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software