-->
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.  [ 2 posts ] 
Author Message
 Post subject: net.sf.hibernate.JDBCException: Could not execute JDBC batch
PostPosted: Thu Jan 13, 2005 5:33 am 
Newbie

Joined: Thu Dec 16, 2004 2:58 am
Posts: 5
Hibernate version:2.1.6

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping package="com.dqian.database">
<class name="UserInfo" table="USER_INFO">
<id
column="USER_ID"
name="Id"
type="integer"
>
<generator class="vm" />
</id>
<property
column="USER_ADDR"
length="200"
name="UserAddr"
not-null="false"
type="string"
/>
<property
column="USER_OTHER"
length="100"
name="UserOther"
not-null="false"
type="string"
/>
<property
column="USER_MOBILE"
length="40"
name="UserMobile"
not-null="false"
type="string"
/>
<property
column="USER_PW"
length="40"
name="UserPw"
not-null="true"
type="string"
/>
<property
column="USER_INFO"
length="400"
name="UserInfo"
not-null="false"
type="string"
/>
<property
column="USER_EMAIL"
length="40"
name="UserEmail"
not-null="false"
type="string"
/>
<property
column="USER_PHONE"
length="40"
name="UserPhone"
not-null="false"
type="string"
/>
<property
column="USER_RNAME"
length="20"
name="UserRname"
not-null="false"
type="string"
/>
<property
column="USER_PRIV"
length="20"
name="UserPriv"
not-null="true"
type="string"
/>
<property
column="USER_NAME"
length="40"
name="UserName"
not-null="true"
type="string"
/>

<many-to-one
class="SupDem"
name="UserSd"
not-null="true"
>
<column name="USER_SD" />
</many-to-one>
<many-to-one
class="Enterprise"
name="UserEnter"
not-null="true"
>
<column name="USER_ENTER" />
</many-to-one>
<many-to-one
class="Product"
name="UserPro"
not-null="true"
>
<column name="USER_PRO" />
</many-to-one>
<set inverse="true" name="PRODUCTSet">
<key column="PRO_USER" />
<one-to-many class="Product" />
</set>
<set inverse="true" name="ENTERPRISESet">
<key column="ENTER_USER" />
<one-to-many class="Enterprise" />
</set>
<set inverse="true" name="SupDemSet">
<key column="SD_USER" />
<one-to-many class="SupDem" />
</set>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
Transaction tx = s.beginTransaction();
s.save(ui);
s.flush();
tx.commit();
s.close();

Full stack trace of any exception that occurs:
net.sf.hibernate.JDBCException: Could not execute JDBC batch update
net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:129)
net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2385)
net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2335)
net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
com.dqian.manager.UserManager.register(UserManager.java:87)
org.apache.jsp.user.regok_jsp._jspService(regok_jsp.java:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
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:810)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:305)


Name and version of the database you are using:oracle of 9.2.0.4

I used HibernateSynchronizer(HS) to generate mapping file automaticly.
As used the method the HS wrapped, the above exception occured, and then, I went to the original hibernate way(code as shown above), the exception occured again.
Any idea?


Top
 Profile  
 
 Post subject: hibernate.cfg.xml
PostPosted: Thu Jan 13, 2005 5:45 am 
Newbie

Joined: Thu Dec 16, 2004 2:58 am
Posts: 5
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory >

<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:oracle:thin:@10.0.0.61:1521:zgxzora</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.username">zgxz</property>
<property name="hibernate.connection.password">zgxz</property>
<!-- property name="hibernate.connection.pool_size"></property -->

<!-- dialect for Oracle 9 -->
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>

<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_outer_join">true</property>

<mapping resource="SupDem.hbm" />
<mapping resource="Enterprise.hbm" />
<mapping resource="Product.hbm" />
<mapping resource="News.hbm" />
<mapping resource="WebNev.hbm" />
<mapping resource="Message.hbm" />
<mapping resource="Town.hbm" />
<mapping resource="Menu.hbm" />
<mapping resource="UserInfo.hbm" />

</session-factory>
</hibernate-configuration>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.