Highlighted

ORM issue after upgrading to CF2018 from CF2011

New Here ,
Dec 31, 2018

Copy link to clipboard

Copied

Hi,

We migrated from CF2011 to CF2018 and then ORM is breaking the EntitySave method and we are getting below error message.

Error Message - The root cause of this exception was: coldfusion.orm.hibernate.HibernateSessionException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1.

We have 2 classes with one-to-many relationship like Email.cfc(parent) and EmailItems.cfc(child). When we try to save Email.cfc object the hybernate crates a UPDATE query for EmailItems as well and this is happening with CF2018 only.

Here is the defined property in Email.cfc.

<cfproperty name="EmailItems" lazy="true" fieldtype="one-to-many" inverse="true" fkcolumn="EmailID" cfc="EmailItem" singularName="EmailItem" type="struct" structkeycolumn="EmailItemKey" structkeytype="string" cascade="none"/>

We are using inverse and it still create a UPDATE query for child class 'EmailItems' which is the reason for failing EntitySave(Email).Everything works fine with CF2011.

Thanks,

Manjeet

Views

204

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

ORM issue after upgrading to CF2018 from CF2011

New Here ,
Dec 31, 2018

Copy link to clipboard

Copied

Hi,

We migrated from CF2011 to CF2018 and then ORM is breaking the EntitySave method and we are getting below error message.

Error Message - The root cause of this exception was: coldfusion.orm.hibernate.HibernateSessionException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1.

We have 2 classes with one-to-many relationship like Email.cfc(parent) and EmailItems.cfc(child). When we try to save Email.cfc object the hybernate crates a UPDATE query for EmailItems as well and this is happening with CF2018 only.

Here is the defined property in Email.cfc.

<cfproperty name="EmailItems" lazy="true" fieldtype="one-to-many" inverse="true" fkcolumn="EmailID" cfc="EmailItem" singularName="EmailItem" type="struct" structkeycolumn="EmailItemKey" structkeytype="string" cascade="none"/>

We are using inverse and it still create a UPDATE query for child class 'EmailItems' which is the reason for failing EntitySave(Email).Everything works fine with CF2011.

Thanks,

Manjeet

Views

205

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 31, 2018 0
New Here ,
Jan 01, 2019

Copy link to clipboard

Copied

In short, Inverse="true" doesn't seem working with ColdFusion 2018.

Please help me with this. We are stuck in the middle of migration of ColdFusion 2018.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 01, 2019 0