-->
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: could not synchronize the database state with session
PostPosted: Tue Aug 08, 2006 3:30 am 
Beginner
Beginner

Joined: Mon Dec 05, 2005 2:59 am
Posts: 31
i have the error of :
ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1

the mapping file is as below:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>

   <class name="model.MCode" table="m_code">
      <id name="id" type="long" unsaved-value="null">
      <column name= "ID"/>
            <generator class="native" />
      
      </id>
      <property name="model" type="string">
         <column name="MODEL" />
      </property>
      <property name="pattern" type="integer">
         <column name="PATTERN" />
      </property>
      <property name="preLabel1" type="string">
         <column name="PRELABEL1" />
      </property>
      <property name="preLabel2" type="string">
         <column name="PRELABEL2" />
      </property>
      <property name="trailingZero" type="integer">
         <column name="TRAILING_ZERO" />
      </property>
      <property name="sequenceNo" type="long">
         <column name="SEQUENCE_NO" />
      </property>
   </class>
</hibernate-mapping>


part of the persistent class is as below:
Code:
public class MCode implements java.io.Serializable,TableData{
   
   public long id;
   public String model;
    public int pattern;
    public String preLabel1;
    public String preLabel2;
    public int trailingZero;
    public long sequenceNo;


the DDL file is as below:
Code:
CREATE TABLE `m_code` (
  `ID` bigint(20) NOT NULL auto_increment,
  `MODEL` varchar(255) default NULL,
  `PATTERN` int(11) default NULL,
  `PRELABEL1` varchar(255) default NULL,
  `PRELABEL2` varchar(255) default NULL,
  `TRAILING_ZERO` int(11) default NULL,
  `SEQUENCE_NO` bigint(20) default NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
;

can anyone help? thanks!!


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.