---
title: "Batch update returned unexpected row count from up"
author: "blueram"
date: "2008-12-18T16:57:55Z"
tags: ["Hibernate", "UP"]
slug: "batch-update-returned-unexpected-row-count-from-up"
draft: false
lastmod: "2008-12-18T16:59:07Z"
id: 296628
url: "https://blueram.iteye.com/blog/296628"
---

ERROR \[http-8080-Processor22] (BatchingBatcher.java:60) - Exception executing batch: org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1

 

今天出现了这个异常，不知从何下手。

 Hibernate: update t\_organization set orgNo=?, name=?, pid=?, description=? where **id=?**

 

 

hibernate 发送的语句，id=? 当我们传过去的值hibernate在数据库中找不到时就回出现这个异常。很多时候都使用BeanUitls.copyProperties() 而不关注主键，这样就回导致这样的异常。