I have an old Lucee application that uses built-in...
# lucee
j
I have an old Lucee application that uses built-in Hibernate ORM. It has worked just fine on Lucee 5.1 and OpenJDK 8 for a long time. I want to switch to Lucee 5.3 and OpenJDK 11, but when I do that I an exception from Hibernate with a message like "identifier of an instance of MyObject was altered from..." when the session is closed (without any actually changes made). Apparently, this is a flaw in change detection due to property type conversion. How can I figure how what needs to be modified so Hibernate isn't fooled?
z
Which specific versions of lucee and the hibernate extension? Always mention them plz when asking for help
j
Specifically, I launched a fresh CommandBox Docker container and configured for lucee@5.1.0+34 and openjdk8 (1.8.0_322 Temurin). That brought the Hibernate extension version 3.5.5.61. This works fine. I launched a fresh CommandBox Docker container and configured for lucee@5.3.8+206 and openjdk1 (11.0.14.1 Adoptium). That brought the Hibernate extension version 3.5.5.77. This shows the error described.
Out of curiosity, I changed to lucee@5.3.9-RC+115, which brings Hibernate ORM extension version 3.5.5.84-SNAPSHOT. This also exhibits the problem.
I tried the prerelease version of the extension, 5.4.29.13-BETA, and that seems to work properly
z
Yeah that's the latest n greatest combination, we've done a lot of work with the ortus team on that
l
There are essentially two versions now of Hibernate. The stable extension is using Hibernate 3.6 and the beta extension is using Hibernate 5.x stable
The jdbc drivers can also influence hibernate, so that can make a difference as well
what is the offending code?
j
@lmajano Well, that's the thing. I'm not sure exactly what the problem is. I've got an entity with a composite key -- all INTs in the database. I suspect that when the parent loads them (with the join strategy) it fools something into thinking that they're modified. This is the component that is being called out as having been changed in the session:
Copy code
<cfcomponent extends="model.BaseORMComponent" persistent="true" schema="Core" readonly="true" output="false">

	<cfproperty name="clientID" fieldtype="id"/>
	<cfproperty name="moduleID" fieldtype="id"/>
	<cfproperty name="productID" fieldtype="id"/>

	<cfproperty name="client" fieldtype="many-to-one" cfc="model.client.Client" fkcolumn="clientID" update="false" insert="false"/>
	<cfproperty name="productModule" fieldtype="many-to-one" cfc="model.product.ProductModule" fkcolumn="moduleID,productID" update="false" insert="false"/>

</cfcomponent>
l
do you mind sharing the stacktrace
j
This is what shows up in
box server log
Let me know if you'd like me to pull from somewhere else