tracker issue : CF-4203461

select a category, or use search below
(searches all categories and all time range)
Title:

CfScript ORM mapping annotation for param/sequence does not work

| View in Tracker

Status/Resolution/Reason: To Test//Fixed

Reporter/Name(from Bugbase): Graham Bakay / ()

Created: 11/13/2018

Components: ORM Support

Versions: 2018

Failure Type: Crash

Found In Build/Fixed In Build: Docker image 2018.0.1 /

Priority/Frequency: Normal / All users will encounter

Locale/System: ALL / Other

Vote Count: 2

Problem Description:
When mapping a sequence to an ORM-mapped component using CfScript annotations, the value for the sequence name is *ignored* and replaced with "hibernate_sequence".

Steps to Reproduce:
Map a component to an Oracle database using annotations and include for the identity column:
/**
 ...
 * @generator "sequence"
 * @params "{sequence='AUDIT_HISTORY_SEQ'}"
*/

Actual Result:
11/13 20:05:07 [http-nio-8500-exec-10] ERROR ORA-02289: sequence does not exist

Hibernate:
    select
        hibernate_sequence.nextval
    from
        dual
11/13 20:05:28 [http-nio-8500-exec-4] ERROR ORA-02289: sequence does not exist

Expected Result:
Hibernate:
    select
        AUDIT_HISTORY_SEQ.nextval
    from
        dual

Any Workarounds:
Downgrade to v2016.

Attachments:

Comments:

Hi Graham, Please attach an isolated test case to this bug that can help me in reproducing this issue. -Nimit  
Comment by Nimit S.
30206 | February 08, 2019 04:59:03 AM GMT
What is unclear about the bug report? Are you expecting me to create an entire Docker project with an Oracle Database container for you to use? That seems like an enormous amount of effort for what is obviously a simple bug (and being a regression, should never have happened). This regression is not limited to the Docker image, it's present in all CF v2018 combinations.
Comment by Graham B.
30212 | February 08, 2019 04:38:14 PM GMT
Can confirm this is happening on not just annotation but property attributes as well. None of the property declaration below works, having the exact error described by OP, seems like Hibernate 5.2 was updated by not fully tested: property name="id" type="Numeric" default="0" ormtype="int" column="COMMENTID" fieldtype="id" notnull="true" unsavedvalue="0" generator="sequence" sequence="COMMENT_SEQ"; property name="id" type="Numeric" default="0" ormtype="int" column="commentId" fieldtype="id" notnull="true" unsavedvalue="0" generator="sequence" params="{'sequence'='COMMENT_SEQ'}"; property name="id" type="Numeric" default="0" ormtype="int" column="commentId" fieldtype="id" notnull="true" unsavedvalue="0" generator="sequence" params="{'sequence-name'='COMMENT_SEQ'}"; Phill Nacelli CTO, AboutWeb, LLC
Vote by Phill N.
30801 | May 21, 2019 05:58:03 PM GMT
Can confirm this is happening on not just annotation but property attributes as well. None of the property declaration below works, having the exact error described by OP, seems like Hibernate 5.2 was updated by not fully tested: property name="id" type="Numeric" default="0" ormtype="int" column="COMMENTID" fieldtype="id" notnull="true" unsavedvalue="0" generator="sequence" sequence="COMMENT_SEQ"; property name="id" type="Numeric" default="0" ormtype="int" column="commentId" fieldtype="id" notnull="true" unsavedvalue="0" generator="sequence" params="{'sequence'='COMMENT_SEQ'}"; property name="id" type="Numeric" default="0" ormtype="int" column="commentId" fieldtype="id" notnull="true" unsavedvalue="0" generator="sequence" params="{'sequence-name'='COMMENT_SEQ'}"; Phill Nacelli CTO, AboutWeb, LLC
Comment by BETH T.
30806 | May 22, 2019 04:06:48 PM GMT
Has there been any further investigation into this issue? We are also seeing ORA-02289: sequence does not exist errors in CF2018. This error only occurs when saving objects using ORM. Investigation so far: 1. The ColdFusion database user definitely has access to these sequences. 2. If we call the sequences directly using cfquery then we get the values expected. For example our onError() function successfully saves the error messages to the database and calls `SELECT AIR_LOG_ID_SEQ.NEXTVAL AS NEXTID FROM DUAL` to get the required ID so we know this works. 3. I created a test.cfm file that selects ALL the sequences we use and outputs them to a display page – this runs as expected without error. 4. The exact same code runs fine on previous versions of ColdFusion. ORM is able to use the Oracle sequences to read and write to the same database. My code is very similar to Phill Nacelli's eg: <cfproperty name="id" hint="Maps to the id of the record." column="area_id" fieldtype="id" generator="sequence" params="{sequence='air_area_id_seq'}" /> Martin Jones Senior Analyst and Developer University of Edinburgh.
Vote by Martin J.
31397 | September 26, 2019 12:07:49 PM GMT
Has there been any further investigation into this issue? We are also seeing ORA-02289: sequence does not exist errors in CF2018. This error only occurs when saving objects using ORM. Investigation so far: 1. The ColdFusion database user definitely has access to these sequences. 2. If we call the sequences directly using cfquery then we get the values expected. For example our onError() function successfully saves the error messages to the database and calls `SELECT AIR_LOG_ID_SEQ.NEXTVAL AS NEXTID FROM DUAL` to get the required ID so we know this works. 3. I created a test.cfm file that selects ALL the sequences we use and outputs them to a display page – this runs as expected without error. 4. The exact same code runs fine on previous versions of ColdFusion. ORM is able to use the Oracle sequences to read and write to the same database. My code is very similar to Phill Nacelli's eg: <cfproperty name="id" hint="Maps to the id of the record." column="area_id" fieldtype="id" generator="sequence" params="{sequence='air_area_id_seq'}" /> Martin Jones Senior Analyst and Developer University of Edinburgh.
Comment by Martin J.
31396 | September 26, 2019 12:09:29 PM GMT
Hi Martin, Are you running the update 5 that was just launched two days ago? Phill Nacelli CTO, AboutWeb, LLC
Comment by Phill N.
31404 | September 26, 2019 01:27:09 PM GMT
Hi Phill, Yes- It was installed today and the issue still persists. Cheers Martin
Comment by Martin J.
31405 | September 26, 2019 01:50:44 PM GMT
Hi Martin, After working with Adobe on documenting and troubleshooting this issue, I received a patch a while back through our customer support channel that resolved the hibernate issue. I reached out to the contact who gave me a patch for this issue to see if it was included in the update 5, but as you mentioned it looks like it was not. Let me check with him if I can make that patch available to you (not sure if there's some client support agreement that we are on that may be a conflict) or ask him to post it here directly (so you're not getting some file from a stranger which I totally understand) or by getting a hold of you directly and let you know. Best, Phill Nacelli CTO, AboutWeb, LLC
Comment by Phill N.
31406 | September 26, 2019 02:00:16 PM GMT
Thanks Phill, The same thing happened to us with a NULL issue and Adobe support shared a hot-fix via Dropbox. I have to say I am worried that they are sharing bug fixes to install on our production servers that they aren't then including in their official patches. Cheers Martin
Comment by Martin J.
31407 | September 26, 2019 02:39:58 PM GMT
Hi Martin, Can you please send an email at cfinstal@adobe.com and mentioned this bug. Thanks, Priyank
Comment by Priyank S.
31408 | September 26, 2019 03:17:16 PM GMT