-->
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.  [ 1 post ] 
Author Message
 Post subject: JDBC Batch Update Error, please help
PostPosted: Fri Jun 03, 2005 12:42 am 
Regular
Regular

Joined: Fri Feb 25, 2005 3:02 am
Posts: 71
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:3.0[/b]

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():
try
{
session = HibernateUtil.currentSession();
for (int i=0; i<smsReceivedVector.size(); i++)
{
SmsReceived smsReceived = (SmsReceived)smsReceivedVector.get(i);
Keyword key = smsReceived.getKeyword();
Set smsReceivedSet = key.getSmsReceiveds();
Hibernate.initialize(smsReceivedSet);
smsReceivedSet.add(smsReceived); // Error occured here
}
//session.flush();
isInsertOk = true;
session.beginTransaction().commit();
}

[/b]

[b]Full stack trace of any exception that occurs:
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.ore_005fsms_jsp._jspService(ore_005fsms_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
</pre></p><p><b>root cause</b> <pre>java.lang.Exception: Add smsReceived Error: Could not execute JDBC batch update
com.gloptv.smsc.PhoneNumber.addSmsReceived(Unknown Source)
com.gloptv.smsc.PhoneNumber$$FastClassByCGLIB$$35f1dac.invoke(&lt;generated&gt;)
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:137)
com.gloptv.smsc.PhoneNumber$$EnhancerByCGLIB$$152db712.addSmsReceived(&lt;generated&gt;)
com.gloptv.smsc.SmsParser.parseSms(Unknown Source)
org.apache.jsp.ore_005fsms_jsp._jspService(ore_005fsms_jsp.java:56)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
[/b]

[b]Name and version of the database you are using:postgresql 8.0[/b]

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

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

Note that all my class are now set to lazy=true. Since, when I try to add a collection of children to a particular parent, I got the above error. Can anyone please help me solve this issue.


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

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.