Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.2
Full stack trace of any exception that occurs:
ERROR 2006-05-15 17:08:10,671 [AWT-EventQueue-0] (BatchingBatcher.java:61) - Exception executing batch:
org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
Name and version of the database you are using: Ms SQL 2000
I am using Hibernate in a standalone program. The above problem only happens when it updates an existing records but not saving a new records.
Not all updates are failed, only when I saw the following "insert" query get genereated. This query is generated when I call
session.createQuery(hql). I don't understand what does the following sql mean and also don't know how to make hibernate not to generate the it. Please help!
The generated SQL (show_sql=true):
Hibernate: insert into erp.dbo.PlasticCostLine (fitting_id, table_id, cost_type_id, composite_id, nums, cost, memo) values (?, ?, ?, ?, ?, ?, ?) select scope_identity()
Kind regards