nageshreddy wrote:
Hi all,
I am getting the above exception when i am trying to execute a simple test application.
The stack trace is as follows
log4j:WARN No appenders could be found for logger (org.springframework.context.support.FileSystemXmlApplicationContext).
log4j:WARN Please initialize the log4j system properly.
we are testing spring:: 11
we are testing spring:: org.springframework.context.support.FileSystemXmlApplicationContext@13a328f
we are testing spring and the application context is:: com.vecna.dms.ApplicationProperties@3a835d
we are testing spring and the application properties workflow bean is :: com.vecna.dms.bussiness.workflow.WorkFlowManagerImpl@aea710
the input straeem is : java.io.FileInputStream@6f8b2b
Hibernate: select max(id) from myname
Hibernate: insert into myname (name, id) values (?, ?)
org.springframework.orm.hibernate3.HibernateSystemException: Batch update returned unexpected row count from update [0]; actual row count: 233258048; expected: 1; nested exception is org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 233258048; expected: 1
Caused by: org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 233258048; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:71)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:24)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:570)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:651)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:621)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:311)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy2.setTesting(Unknown Source)
at test.spring.SpringTest.main(SpringTest.java:38)
I am using the following:
1.Hibernate3
2.MySql5
3.I am using Spring for using hibernate
4.My mapping file is as follows
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.vecna.dms.persistence.Name" table="myname">
<id name="id" column="id"><generator class="increment" /></id>
<property name="name" type="string" column="name"/>
</class>
</hibernate-mapping>
5.My class is :
public class Name {
private String m_name;
private Long m_id;
public Long getId(){
return m_id;
}
public void setId(Long id){
m_id = id;
}
public String getName(){
return m_name;
}
public void setName(String name){
m_name = name;
}
}
My DataSource configuration are as follows.
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost/dms</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>root</value>
</property>
</bean>
Thanks
nagesh
It was a problem with the Mysql Server i used.
Try the Mysql server 5.1.22 and your problem will disappear.