Compound primary keys in Lucee 5.1 with ORM

Testing our apps on Lucee 5.0 & 5.1 and curious if anyone else ran into
this issue.

We have a persistent CFC with all of four properties. Unlike almost every
other persistent CFC we have, it has a compound primary key (due to some
very old design decisions) – one field is an int and the other is a guid.

We can load the entity, but if we try to save it within a transaction
without making any changes, we get:

identifier of an instance of RosterEmbargo was altered from
{seasonID=1, teamID=E6983EDD-BBEB-43D3-BEC2-C648660142C7} to
{seasonID=1.0, teamID=E6983EDD-BBEB-43D3-BEC2-C648660142C7}

Something changes the ‘1’ to a ‘1.0.’ Has anyone run into this? It is typed
as ‘numeric’ for CF with ‘ormtype=“int”’.

Issue & further details reported here:
https://luceeserver.atlassian.net/browse/LDEV-903

All the best,
Sam–
Samuel W. Knowlton
Chief Leagueologist
inLeague * @Samuel_W_Knowlton
http://www.inleague.org

Hi Don,

It’s definitely typed correctly as an int in the db. Furthermore, it’s a
view (the CFC has readonly=true) and the transaction isn’t even trying to
EntitySave this particular Entity - it can’t, since it’s a view and we
don’t update them from the ORM. It’s just related to an entity that is in
the ORM session.

I even tried typing it as a float in the ORM and then got:

identifier of an instance of RosterEmbargo was altered from {seasonID=1.0, teamID=E6983EDD-BBEB-43D3-BEC2-C648660142C7} to {seasonID=1.0, teamID=E6983EDD-BBEB-43D3-BEC2-C648660142C7}

I will probably just replace the offending transaction with SQL since it’s
not a big deal but this is definitely an issue with Lucee’s Hibernate
extension. There’s no reason for Hibernate to even be considering a
readonly CFC in a transaction.On Thursday, June 30, 2016 at 10:35:37 AM UTC-5, Don Quist wrote:

I’ve seen this with ACF, the cfproperty may state int (or integer) as
ormtype, but the actual database type was created as a double or decimal,
so when it was read it came back with a “.0”… Double check the property
type on the database just in case.

I’ve seen this with ACF, the cfproperty may state int (or integer) as
ormtype, but the actual database type was created as a double or decimal,
so when it was read it came back with a “.0”… Double check the property
type on the database just in case.On Wednesday, June 29, 2016 at 7:26:05 AM UTC-7, Samuel W. Knowlton wrote:

Testing our apps on Lucee 5.0 & 5.1 and curious if anyone else ran into
this issue.

We have a persistent CFC with all of four properties. Unlike almost every
other persistent CFC we have, it has a compound primary key (due to some
very old design decisions) – one field is an int and the other is a guid.

We can load the entity, but if we try to save it within a transaction
without making any changes, we get:

identifier of an instance of RosterEmbargo was altered from {seasonID=1, teamID=E6983EDD-BBEB-43D3-BEC2-C648660142C7} to {seasonID=1.0, teamID=E6983EDD-BBEB-43D3-BEC2-C648660142C7}

Something changes the ‘1’ to a ‘1.0.’ Has anyone run into this? It is
typed as ‘numeric’ for CF with ‘ormtype=“int”’.

Issue & further details reported here:
[LDEV-903] - Lucee

All the best,
Sam


Samuel W. Knowlton
Chief Leagueologist
inLeague * s...@inleague.org <javascript:>
http://www.inleague.org