Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » stackOverFlowError
stackOverFlowError [message #871620] Mon, 14 May 2012 14:35 Go to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
Getting a stackoverflow with a onetoone relationship between two entities.
Attached a screen print of the eclipse debug session.

The 2 entities are called CpTransaction and CpTransCoverage.

Field/mapping info for the CpTransaction class entity:

@OneToOne(cascade = CascadeType.ALL, mappedBy = "cpTransaction")
@PrivateOwned
@JoinTable(name = "CP_COVERAGE", joinColumns = @JoinColumn(name = "PARENT_ID", referencedColumnName = "TRANSACTION_ID"))
private CpTransCoverage cpTerrorismCoverage;



Field/mapping info for the CpTransCoverage class entity:

@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "PARENT_ID", nullable = false)
private CpTransaction cpTransaction;

Re: stackOverFlowError [message #871624 is a reply to message #871620] Mon, 14 May 2012 14:47 Go to previous messageGo to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 16.3-b01 (Sun Microsystems Inc.)
Specification-Title: Eclipse Persistence Services
Specification-Vendor: Eclipse.org - EclipseLink Project
Specification-Version: 2.2.0
Implementation-Title: org.eclipse.persistence
Implementation-Vendor: Eclipse.org - EclipseLink Project
Implementation-Version: 2.2.0.v20110202-r8913
Release-Designation: EclipseLink 2.2.0
Premain-Class: org.eclipse.persistence.internal.jpa.deployment.JavaSEC
MPInitializerAgent
Re: stackOverFlowError [message #871690 is a reply to message #871624] Mon, 14 May 2012 17:27 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
This mapping is not setup correctly - I would hope that hte @JoinTable annotation on the CpTransCoverage cpTerrorismCoverage relationship is ignored, but you should remove it if you wish to have this relationship really 'mappedby' the cpTransaction relationship. Mappedby indicates that all mapping information and control is held in the cpTransaction mapping, which is configured to use its "PARENT_ID" as a foreign key. Please correct this and see if it helps. If it does not, please provide any caching settings you may be using.

You may also want to try a later release - while I don't know of any issues related to this, it will rule out that it has been fixed by refactoring changes.
Re: stackOverFlowError [message #871706 is a reply to message #871690] Mon, 14 May 2012 17:56 Go to previous messageGo to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
When I removed the "MappedBy" parm in CpTransaction, I get the following error

Internal Exception: java.sql.SQLException: [SQL0205] Column CPTERRORISMCOVERAGE_COVERAGE_ID not in table CP_COVERAGE in WBQUOTEVI.
Error Code: -205
Call: SELECT t1.COVERAGE_ID, t1.COVERAGE_TYPE, t1.BUILDING_NUMBER, t1.COV_GROUP, t1.COVERAGE_CLASS_CODE, t1.COVERAGE_CODE, t1.COVERAGE_DESC, t1.FORM_NUMBER, t1.LIABILITY_LIMIT, t1.LOB_CODE, t1.LOCATION_NUMBER, t1.PREMIUM_ACTUAL, t1.PREMIUM_MEET_MIN, t1.PREMIUM_MIN, t1.PREMIUM_OVERRIDE, t1.PREMIUM_OVERRIDE_RESET, t1.PREMIUM_PREVIOUS, t1.PREMIUM_PREVIOUS_PRO, t1.RATED_COVERAGE_FLAG, t1.RATING_MODIFIED_RATE, t1.RATING_ORIGINAL_RATE, t1.RATING_RMF, t1.SORT_SEQ, t1.STATE_CODE, t1.SUBCOVERAGE_DESC, t1.ACTION_CODE, t1.BLANKET_ID, t1.PARENT_ID FROM CP_COVERAGE t0, CP_COVERAGE t1 WHERE (((t0.PARENT_ID = ?) AND (t1.COVERAGE_ID = t0.cpTerrorismCoverage_COVERAGE_ID)) AND (t1.COVERAGE_TYPE = ?))
bind => [81111, P]
Query: ReadObjectQuery(name="cpTerrorismCoverage" referenceClass=CpTransCoverage sql="SELECT t1.COVERAGE_ID, t1.COVERAGE_TYPE, t1.BUILDING_NUMBER, t1.COV_GROUP, t1.COVERAGE_CLASS_CODE, t1.COVERAGE_CODE, t1.COVERAGE_DESC, t1.FORM_NUMBER, t1.LIABILITY_LIMIT, t1.LOB_CODE, t1.LOCATION_NUMBER, t1.PREMIUM_ACTUAL, t1.PREMIUM_MEET_MIN, t1.PREMIUM_MIN, t1.PREMIUM_OVERRIDE, t1.PREMIUM_OVERRIDE_RESET, t1.PREMIUM_PREVIOUS, t1.PREMIUM_PREVIOUS_PRO, t1.RATED_COVERAGE_FLAG, t1.RATING_MODIFIED_RATE, t1.RATING_ORIGINAL_RATE, t1.RATING_RMF, t1.SORT_SEQ, t1.STATE_CODE, t1.SUBCOVERAGE_DESC, t1.ACTION_CODE, t1.BLANKET_ID, t1.PARENT_ID FROM CP_COVERAGE t0, CP_COVERAGE t1 WHERE (((t0.PARENT_ID = ?) AND (t1.COVERAGE_ID = t0.cpTerrorismCoverage_COVERAGE_ID)) AND (t1.COVERAGE_TYPE = ?))")} Local Exception Stack: ;Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException;Internal Exception: java.sql.SQLException: [SQL0205] Column CPTERRORISMCOVERAGE_COVERAGE_ID not in table CP_COVERAGE in WBQUOTEVI.;Error Code: -205;Call: SELECT t1.COVERAGE_ID, t1.COVERAGE_TYPE, t1.BUILDING_NUMBER, t1.COV_GROUP, t1.COVERAGE_CLASS_CODE, t1.COVERAGE_CODE, t1.COVERAGE_DESC, t1.FORM_NUMBER, t1.LIABILITY_LIMIT, t1.LOB_CODE, t1.LOCATION_NUMBER, t1.PREMIUM_ACTUAL, t1.PREMIUM_MEET_MIN, t1.PREMIUM_MIN, t1.PREMIUM_OVERRIDE, t1.PREMIUM_OVERRIDE_RESET, t1.PREMIUM_PREVIOUS, t1.PREMIUM_PREVIOUS_PRO, t1.RATED_COVERAGE_FLAG, t1.RATING_MODIFIED_RATE, t1.RATING_ORIGINAL_RATE, t1.RATING_RMF, t1.SORT_SEQ, t1.STATE_CODE, t1.SUBCOVERAGE_DESC, t1.ACTION_CODE, t1.BLANKET_ID, t1.PARENT_ID FROM CP_COVERAGE t0, CP_COVERAGE t1 WHERE (((t0.PARENT_ID = ?) AND (t1.COVERAGE_ID = t0.cpTerrorismCoverage_COVERAGE_ID)) AND (t1.COVERAGE_TYPE = ?));bind => [81111, P];Query: ReadObjectQuery(name="cpTerrorismCoverage" referenceClass=CpTransCoverage sql="SELECT t1.COVERAGE_ID, t1.COVERAGE_TYPE, t1.BUILDING_NUMBER, t1.COV_GROUP, t1.COVERAGE_CLASS_CODE, t1.COVERAGE_CODE, t1.COVERAGE_DESC, t1.FORM_NUMBER, t1.LIABILITY_LIMIT, t1.LOB_CODE, t1.LOCATION_NUMBER, t1.PREMIUM_ACTUAL, t1.PREMIUM_MEET_MIN, t1.PREMIUM_MIN, t1.PREMIUM_OVERRIDE, t1.PREMIUM_OVERRIDE_RESET, t1.PREMIUM_PREVIOUS, t1.PREMIUM_PREVIOUS_PRO, t1.RATED_COVERAGE_FLAG, t1.RATING_MODIFIED_RATE, t1.RATING_ORIGINAL_RATE, t1.RATING_RMF, t1.SORT_SEQ, t1.STATE_CODE, t1.SUBCOVERAGE_DESC, t1.ACTION_CODE, t1.BLANKET_ID, t1.PARENT_ID FROM CP_COVERAGE t0, CP_COVERAGE t1 WHERE (((t0.PARENT_ID = ?) AND (t1.COVERAGE_ID = t0.cpTerrorismCoverage_COVERAGE_ID)) AND (t1.COVERAGE_TYPE = ?))");at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333);at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:684);at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:526);at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1729);at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:566);at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207);at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193);at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectOneRow(DatasourceCallQueryMechanism.java:667);at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRowFromTable(ExpressionQueryMechanism.java:2603);at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRow(ExpressionQueryMechanism.java:2574);at org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:444);at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1080);at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:808);at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1040);at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:412);at org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2800);at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1521);at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1503);at org.eclipse.persistence.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolicy.java:323);at org.eclipse.persistence.mappings.ForeignReferenceMapping.valueFromRowInternal(ForeignReferenceMapping.java:2061);at org.eclipse.persistence.mappings.OneToOneMapping.valueFromRowInternal(OneToOneMapping.java:1635);at org.eclipse.persistence.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java:1950);at org.eclipse.persistence.mappings.ForeignReferenceMapping.readFromRowIntoObject(ForeignReferenceMapping.java:1332);at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:344);at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:694);at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:612);at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:565);at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:497);at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:456);at org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:723);at org.eclipse.persistence.queries.ReadAllQuery.registerResultInUnitOfWork(ReadAllQuery.java:742);at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:423);at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1080);at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:808);at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1040);at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:383);at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1126);at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2842);at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1521);at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1503);at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1477);at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:484);at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:741);at com.gmrc.jpa.domain.controller.CpTransactionManagerImpl.findByProperty(CpTransactionManagerImpl.java:921);at com.gmrc.jpa.domain.controller.CpTransactionManagerImpl.findByPolicyNumber(CpTransactionManagerImpl.java:750);at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method);at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60);at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37);at java.lang.reflect.Method.invoke(Method.java:611);at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307);at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182);at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149);at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:138);at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171);at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106);at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171);at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204);at $Proxy122.findByPolicyNumber(Unknown Source);at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method);at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60);at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37);at java.lang.reflect.Method.invoke(Method.java:611);at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307);at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198);at $Proxy123.findByPolicyNumber(Unknown Source);at com.gmrc.jpa.domain.service.ManagedCpTransactionService.isLastTransactionCheck(ManagedCpTransactionService.java:138);at com.gmrc.cpp.struts.actions.OpenAction.open(OpenAction.java:142);at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method);at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60);at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37);at java.lang.reflect.Method.invoke(Method.java:611);at com.gmrc.cpp.struts.actions.CppBaseAction.dispatchMethod(CppBaseAction.java:962);at com.gmrc.cpp.struts.actions.CppBaseAction.execute(CppBaseAction.java:330);at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110);at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431);at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236);at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196);at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414);at javax.servlet.http.HttpServlet.service(HttpServlet.java:575);at javax.servlet.http.HttpServlet.service(HttpServlet.java:668);at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214);at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774);at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456);at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178);at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125);at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92);at org.ajaxanywhere.AAFilter.doFilter(AAFilter.java:46);at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192);at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89);at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926);at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023);at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703);at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304);at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962);at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662);at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195);at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452);at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511);at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305);at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83);at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165);at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217);at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161);at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138);at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204);at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775);at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905);at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659);Caused by: java.sql.SQLException: [SQL0205] Column CPTERRORISMCOVERAGE_COVERAGE_ID not in table CP_COVERAGE in WBQUOTEVI.;at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650);at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621);at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1557);at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:193);at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:2025);at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1967);at com.ibm.as400.access.AS400JDBCConnectionHandle.prepareStatement(AS400JDBCConnectionHandle.java:915);at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.pmiPrepareStatement(WSJdbcConnection.java:2530);at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2775);at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2723);at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.prepareStatement(DatabaseAccessor.java:1402);at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.prepareStatement(DatabaseAccessor.java:1351);at org.eclipse.persistence.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:658);at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:576);... 106 more;
Re: stackOverFlowError [message #871709 is a reply to message #871706] Mon, 14 May 2012 18:01 Go to previous messageGo to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
I should mention CpTransCoverage extends another class called CpCoverage. Here is some info about that entity.

@Entity
@Table(name = "CP_COVERAGE")
@Converter(name = "boolean", converterClass = com.gmrc.jpa.domain.mappings.converters.BooleanYNConverter.class)
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "COVERAGE_TYPE", discriminatorType = DiscriminatorType.STRING, length = 1)
public class CpCoverage extends BaseDomain {


More info on the CpTransCoverage entity:

@Entity
@DiscriminatorValue(value = "P")
public class CpTransCoverage extends CpCoverage {
Re: stackOverFlowError [message #871719 is a reply to message #871709] Mon, 14 May 2012 18:32 Go to previous messageGo to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
After re-reading your post, I think I may have screwed up.

Did you mean for me to remove the:

@JoinTable(name = "CP_COVERAGE", joinColumns = @JoinColumn(name = "PARENT_ID", referencedColumnName = "TRANSACTION_ID"))

line. Or did you mean to remove the "MappedBy" parameter in the @OneToOne annotation ?
Re: stackOverFlowError [message #871729 is a reply to message #871719] Mon, 14 May 2012 18:59 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
I thought removing the JoinTable would be more likely since you have the backpointer using a foriegn key. In the end, all that matters is the object model and the database are aligned - use either the foreign key or the join table but not both for what seems to be the same relationship.
Removing the mappedby means you would have 2 uni-directional and thus independent relationships.

Looking at the error and inheritance you posted though, CP_COVERAGE is not a join table at all, and so the @JoinTable annotation should be removed.
Re: stackOverFlowError [message #872153 is a reply to message #871729] Tue, 15 May 2012 14:50 Go to previous messageGo to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
I do not see a "foriegn key" annotation. What am I missing ?
Re: stackOverFlowError [message #872187 is a reply to message #872153] Tue, 15 May 2012 16:02 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Hello,

@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "PARENT_ID", nullable = false)
private CpTransaction cpTransaction;

sets up the cpTransaction relationship to use the "PARENT_ID" field in the CpTransCoverage table as a foreign key defaulting to the CpTransaction ID field. I would assume that you are trying to setup a CpTransaction->CpTransCoverage back reference that also uses this database foriegn key relationship, in which case the CpTransCoverage cpTerrorismCoverage relation needs to use the mappedby and remove the @jointable annotations. If that is not the case, please describe what you are trying to do.

Best Regards,
Chris
Re: stackOverFlowError [message #873173 is a reply to message #871620] Thu, 17 May 2012 16:20 Go to previous messageGo to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
I greatly appreciate your assistance. Unfortunately,
I'm still having the same issue.

After some further googling, I saw a suggestion to move the
annotation code from the member field to the getter method.
Would this maybe help ?

Also saw the @PrimaryKeyJoinColumn annotation and was wondering
about that as well.

Thanks.
Re: stackOverFlowError [message #873174 is a reply to message #873173] Thu, 17 May 2012 16:23 Go to previous messageGo to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
Also, on the CP_TRANSACTION entity, we use
@Cache(type=CacheType.NONE, alwaysRefresh = true)
Re: stackOverFlowError [message #873218 is a reply to message #873174] Thu, 17 May 2012 18:11 Go to previous messageGo to next message
Chris V is currently offline Chris VFriend
Messages: 10
Registered: February 2012
Junior Member
Never mind about @PrimaryKeyJoinColumn
Re: stackOverFlowError [message #873230 is a reply to message #873218] Thu, 17 May 2012 18:57 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
@Cache(type=CacheType.NONE, alwaysRefresh = true) is what is likely causing the problem. Try removing the type=CacheType.NONE as this is very bad - In conjunction with the alwaysRefresh and the always cascade and the bidirectional relationships, it means when it goes to build one object from the database it will always then have to build the CP_TRANSACTION, which will inturn cause the referenced object to be again rebuilt from the database (since the object being built in the cache). Using CacheType.NONE really should be avoided except in extreme situations. As the javadoc for the setting notes "This cache type should not be used to disable caching, to properly disable caching set the @Cache isolation attribute to ISOLATED."

Hope this helps.

Best Regards,
Chris
Previous Topic:delimited-identifiers as global option
Next Topic:Help on clone method
Goto Forum:
  


Current Time: Thu Apr 25 05:27:52 GMT 2024

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

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

Back to the top