I get the following errors every time I perform very simple save operations in ColdFusion 9.01 ORM:
An exception to the hibernation operation. Either the updated / deleted row does not exist, or the session contains outdated data. Root reason: org.hibernate.StaleStateException: a batch update returned an unexpected row count from update [0]; actual number of rows: 0; expected: 1
The following code will actually update the object in the database, but this error appears at the bottom of the page, presumably when Coldfusion automatically calls ormFlush () at the end of the request.
<cfscript> myDeal = entityloadbypk('serviceCategory',1); myDeal.setScName('Automotive1'); EntitySave(myDeal); writedump(myDeal); </cfscript>
Here is the object I'm working with, however this problem occurs when executing multiple objects.
<cfscript> component{ property name="scID" fieldtype="id" datatype="int" generator="native"; property string scName; property priority; property name="serviceSubCategory" fieldtype="one-to-many" cfc="serviceSubCategory" fkcolumn="scID"; public array function getSubCategoryByPriority(){ return EntityLoad("serviceSubCategory", {scID=getscID()}, "Priority ASC"); } } </cfscript>
My current thought is that the Hibernate package has some old object (not related to the object in the code) that fails every time Hibernate launches the add / update package. Please, help!!!
source share