-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: unable to insert a record for joined-subclass
PostPosted: Mon Aug 01, 2005 8:02 am 
Newbie

Joined: Tue Jun 14, 2005 12:16 am
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:[/b] 2

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

List facilityLimitList=session.find("from NcFacilityLimit fac where fac.FacilityKey=?",ncFacility.getFacilityKey(),Hibernate.INTEGER);
if(!facilityLimitList.isEmpty()){
System.out.print("hkj");
ncFacilityLimit=(NcFacilityLimit)facilityLimitList.get(0);
}
else{
ncFacilityLimit=new NcFacilityLimit();
}
ncFacilityLimit.setCurrentLimitAmount(facilityVO.getFacilityLimit().getCurrentLimitAmount());
ncFacilityLimit.setFinalMaturityDate(facilityVO.getFacilityLimit().getFinalMaturityDate());


[b]Full stack trace of any exception that occurs:[/b]
net.sf.hibernate.exception.ConstraintViolationException: could not insert: [com.nucleus.server.app.facility.persistence.facilitylimit.NcFacilityLimit#3509]
at java.lang.Throwable.<init>(Throwable.java:59)
at java.lang.Throwable.<init>(Throwable.java:73)
at net.sf.hibernate.exception.NestableException.<init>(NestableException.java:180)
at net.sf.hibernate.JDBCException.<init>(JDBCException.java:34)
at net.sf.hibernate.exception.ConstraintViolationException.<init>(ConstraintViolationException.java:35)
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:73)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)
at net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:464)
at net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:426)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261)
at com.nucleus.server.arch.persistence.session.NucleusSession.save(NucleusSession.java:374)
at com.nucleus.server.app.facility.business.FacilityFactory.saveFacilityDetails(FacilityFactory.java)
at com.nucleus.server.app.facility.business.FacilityManager.saveFacilityDetails(FacilityManager.java:154)
at com.nucleus.server.app.facility.service.FacilityServiceBean.saveFacilityDetails(FacilityServiceBean.java:115)
at com.nucleus.server.app.facility.service.EJSRemoteStatelessFacilityService_f351346d.saveFacilityDetails(EJSRemoteStatelessFacilityService_f351346d.java:115)
at com.nucleus.server.app.facility.service._FacilityService_Stub.saveFacilityDetails(_FacilityService_Stub.java:413)
at com.nucleus.server.delegate.FacilityServiceDelegate.saveFacilityDetails(FacilityServiceDelegate.java:128)
at com.nucleus.web.app.facility.actions.FacilitySaveAction.saveFacilityDetails(FacilitySaveAction.java:65)
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into ("NUCLEUS"."NC_FACILITY"."REGION_ID")

at java.lang.Throwable.<init>(Throwable.java:59)
at java.lang.Throwable.<init>(Throwable.java:73)
at java.sql.SQLException.<init>(SQLException.java:52)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1889)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:454)
at net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:426)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261)
at com.nucleus.server.arch.persistence.session.NucleusSession.save(NucleusSession.java:374)
at com.nucleus.server.app.facility.business.FacilityFactory.saveFacilityDetails(FacilityFactory.java)
at com.nucleus.server.app.facility.business.FacilityManager.saveFacilityDetails(FacilityManager.java:154)
at com.nucleus.server.app.facility.service.FacilityServiceBean.saveFacilityDetails(FacilityServiceBean.java:115)
at com.nucleus.server.app.facility.service.EJSRemoteStatelessFacilityService_f351346d.saveFacilityDetails(EJSRemoteStatelessFacilityService_f351346d.java:115)
at com.nucleus.server.app.facility.service._FacilityService_Stub.saveFacilityDetails(_FacilityService_Stub.java:413)
at com.nucleus.server.delegate.FacilityServiceDelegate.saveFacilityDetails(FacilityServiceDelegate.java:128)
at com.nucleus.web.app.facility.actions.FacilitySaveAction.saveFacilityDetails(FacilitySaveAction.java:65)
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)



[b]Name and version of the database you are using:[/b]
Oracle 8

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]


its throwing the exception:
net.sf.hibernate.exception.ConstraintViolationException: could not insert:


plz let me know the reason and whts the go on this.

Thanks,
Ramesh Sriramoju


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 8:05 am 
Newbie

Joined: Tue Jun 14, 2005 12:16 am
Posts: 3
sorry ,
a small code addition to the previous post..



session.saveOrUpdate(ncFacility);
//session.save(ncFacility);

session.save(ncFacilityLimit);
session.commitTransaction();


Thanks,
R Sriramoju


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 8:14 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
not showing all required information doesn't make it easier to help you.

In your stacktrace you can find this:
Code:
Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into ("NUCLEUS"."NC_FACILITY"."REGION_ID")


Because i don't know your mappings/POJOs, i cannot tell you if it's a mapping-problem or you've simply forgot to set the values
etc.

So please provide all required information.

gtx
curio


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 8:24 am 
Newbie

Joined: Tue Jun 14, 2005 12:16 am
Posts: 3
curio wrote:
not showing all required information doesn't make it easier to help you.

In your stacktrace you can find this:
Code:
Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into ("NUCLEUS"."NC_FACILITY"."REGION_ID")


Because i don't know your mappings/POJOs, i cannot tell you if it's a mapping-problem or you've simply forgot to set the values
etc.

So please provide all required information.

gtx
curio



Thanks for reply,
the value for region is set to right only.
the code working fine when iam doing updating the existing record,
but its showing the above exception when iam trying to insert a new record if the record is not avaible.

thanks,
R. Sriramoju


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 8:44 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
just a question ... why are you not posting the required information?
I can't help you, if not ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.