I have a very big problem with Hibernate. When I try to Update or Save an element in a table, I have this error:
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
This error is produced when I call my DAO service:
Session session = sessionFactory.getCurrentSession();
session.saveOrUpdate(object);
session.flush();
When I debug, after flush() the error is generated.
Here the Key of the table:
@EmbeddedId
@AttributeOverrides( {
@AttributeOverride(name = "sysDocId", column = @Column(name = "SYS_DOC_ID", nullable = false)),
@AttributeOverride(name = "sysDataFile", column = @Column(name = "SYS_DATA_FILE", nullable = false)) })
public RelDocFileId getId() {
return this.id;
}
Thanks All