Hibernate version: 3.2.2 GA
Full stack trace of any exception that occurs:
[2/5/07 15:04:12:450 IST] 00000036 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "calculateAgreement" on bean "BeanId(RUBY_EAR#UnderwritingEJB.jar#UnderwritingFacade, null)". Exception data: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.generali.ruby.bo.AbstractRolesBO
at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
at org.hibernate.type.EntityType.replace(EntityType.java:253)
at org.hibernate.type.AbstractType.replace(AbstractType.java:153)
at org.hibernate.type.TypeFactory.replace(TypeFactory.java:495)
at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:377)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:179)
at com.generali.ruby.utils.persistance.RubyMergeEventListener.entityIsTransient(RubyMergeEventListener.java:799)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:123)
at com.generali.ruby.utils.persistance.RubyMergeEventListener.onMerge(RubyMergeEventListener.java:76)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:687)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:669)
at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:245)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java(Inlined Compiled Code))
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascade(Cascade.java(Compiled Code))
at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:407)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:152)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:126)
at com.generali.ruby.utils.persistance.RubyMergeEventListener.onMerge(RubyMergeEventListener.java:76)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
at com.generali.ruby.bo.BusinessObject.merge(BusinessObject.java:96)
at com.generali.ruby.services.underwriting.UnderwritingFacadeBean.calculateAgreement(UnderwritingFacadeBean.java:8349)
at com.generali.ruby.services.underwriting.EJSRemoteStatelessUnderwritingFacade_84e0e0cf.calculateAgreement(EJSRemoteStatelessUnderwritingFacade_84e0e0cf.java:2043)
at com.generali.ruby.services.underwriting._UnderwritingFacade_Stub.calculateAgreement(_UnderwritingFacade_Stub.java:2814)
at com.generali.ruby.delegate.underwriting.UnderwritingBD.calculateAgreement(UnderwritingBD.java:1178)
at com.generali.ruby.ui.underwriting.newapplication.action.CalculateAgreementAction.calculateAgreement(CalculateAgreementAction.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at com.generali.ruby.base.action.RUBYBaseDispatchAction.execute(RUBYBaseDispatchAction.java:179)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:69)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:250)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1058)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:451)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:312)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at com.generali.ruby.filters.WorkFlowFilter.doFilter(WorkFlowFilter.java:83)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Name and version of the database you are using: Db2 7.2.5
I was consistently getting the above exception. Then, I after going through a few posts I changed the version property field of my class from
protected Integer version = null;
to
protected Integer version = new Integer(1);
and I stopped getting the TransientObjectException and Instead got another exception: NonUniqueObjectExection.
Exception Stack Trace :
[2/6/07 17:55:24:759 IST] 00000034 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "calculateAgreement" on bean "BeanId(RUBY_EAR#UnderwritingEJB.jar#UnderwritingFacade, null)". Exception data: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.generali.ruby.bo.poa.PoaVTGRoleInfoItemBO#1m#!!;"!]
at org.hibernate.engine.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:577)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:284)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:223)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:89)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java(Compiled Code))
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java(Inlined Compiled Code))
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascade(Cascade.java(Compiled Code))
at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java(Compiled Code))
at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java(Compiled Code))
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
at com.generali.ruby.bo.RenewalPeriodBO.fetchNextRenewalPeriod(RenewalPeriodBO.java:181)
at com.generali.ruby.bo.ExpectedPremiumPartBO.calculatePremiumPart(ExpectedPremiumPartBO.java:2284)
at com.generali.ruby.bo.PolicyBO.calculateAgreement(PolicyBO.java:12711)
at com.generali.ruby.services.underwriting.UnderwritingFacadeBean.calculateAgreement(UnderwritingFacadeBean.java:8500)
at com.generali.ruby.services.underwriting.EJSRemoteStatelessUnderwritingFacade_84e0e0cf.calculateAgreement(EJSRemoteStatelessUnderwritingFacade_84e0e0cf.java:2043)
at com.generali.ruby.services.underwriting._UnderwritingFacade_Stub.calculateAgreement(_UnderwritingFacade_Stub.java:2814)
at com.generali.ruby.delegate.underwriting.UnderwritingBD.calculateAgreement(UnderwritingBD.java:1178)
at com.generali.ruby.ui.underwriting.newapplication.action.CalculateAgreementAction.calculateAgreement(CalculateAgreementAction.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at com.generali.ruby.base.action.RUBYBaseDispatchAction.execute(RUBYBaseDispatchAction.java:179)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:69)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:250)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1058)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:451)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:312)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at com.generali.ruby.filters.WorkFlowFilter.doFilter(WorkFlowFilter.java:83)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Are these related in any way?
In this context I want to know,
1. Is this change correct? Should we continue using it? 2. Is the second error a consequence of this change? 3. Is there any other major implication of using this? How will other parts of the application get affected due to this change?
Please advise
Thanks,
Hitesh
|