Hi!
This is senthil, i'm face below Error can anyone help,
CODE USED:
sessionFactory = new Configuration().configure().buildSessionFactory();
public static Session getNewSession() throws HibernateException {
Session s = sessionFactory.openSession();
s.setCacheMode(CacheMode.IGNORE);
s.setFlushMode(FlushMode.COMMIT);
session.set(s);
return s;
}
actually i'm trying to insert a value for object to another object,while doing so i'm finding this
ERROR DISPLAYED ON SERVER CONSOLE:
13:13:25,843 ERROR AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: could not insert: [com.infony.model.PurRequisitionDetails]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2068)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2417)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:877)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:344)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.infony.pages.PurchaseRequisitionPage.saveRec(PurchaseRequisitionPage.java:717)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(ListenerMethodInvokerImpl.java:214)
at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:155)
at org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(ListenerMethodInvokerImpl.java:124)
at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:69)
at org.apache.tapestry.listener.SyntheticListener.actionTriggered(SyntheticListener.java:51)
at org.apache.tapestry.listener.ListenerInvokerTerminator.invokeListener(ListenerInvokerTerminator.java:51)
at $ListenerInvoker_11153d8729c.invokeListener($ListenerInvoker_11153d8729c.java)
at org.apache.tapestry.form.AbstractSubmit$1.run(AbstractSubmit.java:88)
at org.apache.tapestry.form.FormSupportImpl.runDeferredRunnables(FormSupportImpl.java:608)
at org.apache.tapestry.form.FormSupportImpl.rewind(FormSupportImpl.java:589)
at org.apache.tapestry.form.Form.renderComponent(Form.java:226)
at $Form_8.renderComponent($Form_8.java)
at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
at org.apache.tapestry.form.Form.rewind(Form.java:327)
at org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:439)
at org.apache.tapestry.form.Form.trigger(Form.java:338)
at org.apache.tapestry.engine.DirectService.triggerComponent(DirectService.java:146)
at org.apache.tapestry.engine.DirectService.service(DirectService.java:132)
at $IEngineService_11153d872f4.service($IEngineService_11153d872f4.java)
at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:66)
at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:248)
at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
at $WebRequestServicer_11153d872d0.service($WebRequestServicer_11153d872d0.java)
at $WebRequestServicer_11153d872cc.service($WebRequestServicer_11153d872cc.java)
at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:56)
at $ServletRequestServicer_11153d872b2.service($ServletRequestServicer_11153d872b2.java)
at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
at $ServletRequestServicerFilter_11153d872ae.service($ServletRequestServicerFilter_11153d872ae.java)
at $ServletRequestServicer_11153d872b4.service($ServletRequestServicer_11153d872b4.java)
at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
at $ServletRequestServicerFilter_11153d872ac.service($ServletRequestServicerFilter_11153d872ac.java)
at $ServletRequestServicer_11153d872b4.service($ServletRequestServicer_11153d872b4.java)
at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
at $ServletRequestServicerFilter_11153d872b0.service($ServletRequestServicerFilter_11153d872b0.java)
at $ServletRequestServicer_11153d872b4.service($ServletRequestServicer_11153d872b4.java)
at $ServletRequestServicer_11153d872a6.service($ServletRequestServicer_11153d872a6.java)
at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:168)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:286)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:256)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:210)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:196)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:175)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:207)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:647)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:497)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:649)
at java.lang.Thread.run(Thread.java:595)
Regards,
senthil.D
|