利用hibernate 的save() 插入数据0 actual row count: 0 expected: 1

我用的springside+hibernate3+struts.2.0开发的
已经调了很长时间 找不到解决方法;谢谢:

一直在待回帖
2007-08-16 15:36:33,531 ERROR [org.hibernate.jdbc.AbstractBatcher] - <Exception executing
batch: >
org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
at org.hibernate.jdbc.BatchingBatcher.checkRowCount(BatchingBatcher.java:93)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:79)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(Abstrac
tFlushingEventListener.java:296)


我的hbm。xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
    Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
    <class name="com.cnc.oa.domain.TProMd5" table="t_pro_md5" catalog="oa">
        <id name="processId" type="java.lang.String" unsaved-value="null">
            <column name="processID" length="50" />
            <generator class="assigned" />
        </id>
        <property name="mdproId" type="java.lang.String">
            <column name="mdproID" length="50" not-null="true" />
        </property>
        <property name="formcode" type="java.lang.Integer">
            <column name="formcode" not-null="true" />
        </property>
    </class>
</hibernate-mapping>


我的action 调用save后就报上面的错

public class SendDocmentInfoAction extends BaseAction{
public String save(){
try{

        tProMd5 = new TProMd5();
        tProMd5.setFormcode(formcode);
        tProMd5.setProcessId(proId);
        tProMd5.setMdproId(unid);
        );
//能得到formcode  +proId unid                                                         
   System.out.println("md5save" +formcode +proId +unid);       

                                                  
        sendDocmentMd5Manager.save(tProMd5);

        }catch(Exception e){
        e.printStackTrace();
        return INPUT;
        }
        saveMessage("数据" + (id == null ? "新增" : "保存") + "成功!");       
        return SUCCESS;
}
}

你可能感兴趣的:(java,Hibernate,jdbc,struts,MyEclipse)