Can someone tell me which is the cause of the exception? It occurs when saving a new user data. The query seems to be for updating, but not for creating a user data.
Thanks very much in advance for your kindly helps.
Hibernate version: 2.1.7
Mapping documents:
<class name="com.xxx.domain.User" table="users">
<id name="id" type="int" unsaved-value="null" >
<generator class="native"/>
</id>
<property name="cityId" type="int" not-null="true"/>
<property name="username" type="string" not-null="true"/>
<property name="password" type="string" not-null="true"/>
<property name="name" type="string" not-null="true"/>
<property name="email" type="string" not-null="true"/>
<property name="timeOfCreation" type="calendar" not-null="true"/>
<property name="status" type="int"/>
<property name="IPAddress" type="string" not-null="true"/>
<!-- Mapping for the component class Address. -->
<component name="address" class="com.xxx.domain.Address">
<property name="street1" type="string"/>
<property name="street2" type="string" />
<property name="postalCode" type="string" not-null="true"/>
<property name="city" type="string" not-null="true"/>
<property name="province" type="string" not-null="true"/>
<property name="country" type="string" not-null="true"/>
</component>
</class>
Code between sessionFactory.openSession() and session.close():
saveOrUpdate(user)
Full stack trace of any exception that occurs:
2005-04-17 09:26:00,031 DEBUG com.xxx.data.hibernate.HibernateUserDao - com.xxx.domain.User@8d2280[
id=<null>
username=myUsername
password=myPassword
timeOfCreation=java.util.GregorianCalendar[time=1113755159968,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT-08:00",offset=-28800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2005,MONTH=3,WEEK_OF_YEAR=17,WEEK_OF_MONTH=4,DAY_OF_MONTH=17,DAY_OF_YEAR=107,DAY_OF_WEEK=1,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=8,HOUR_OF_DAY=8,MINUTE=25,SECOND=59,MILLISECOND=968,ZONE_OFFSET=-28800000,DST_OFFSET=0]
name=myName
address=Street1: 'my street 1', Street2: 'my street 2', PostalCode: '90210', City: 'BEVERLY HILLS', Province: 'CA', Country: 'US'
email=baddy@mail.com
IPAddress=127.0.0.1
status=1
cityId=852
]
Hibernate: update users set cityId=?, username=?, password=?, name=?, email=?, timeOfCreation=?, status=?, IPAddress=?, street1=?, street2=?, postalCode=?, city=?, province=?, country=? where id=?
2005-04-17 09:26:00,484 ERROR net.sf.hibernate.impl.SessionImpl - Could not synchronize database state with session
2005-04-17 09:26:00,484 ERROR org.springframework.web.servlet.DispatcherServlet - Could not complete request
org.springframework.orm.hibernate.HibernateSystemException: Batch update row count wrong: 0; nested exception is net.sf.hibernate.HibernateException: Batch update row count wrong: 0
net.sf.hibernate.HibernateException: Batch update row count wrong: 0
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:65)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:127)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2441)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2260)
Name and version of the database you are using:
The generated SQL (show_sql=true):
PostgreSQL 8.0
Debug level Hibernate log excerpt:
|