Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 900795 (JBPAPP6-1220)

Summary: HHH-4635 - Oracle ORA-24816 inserting and updating data for entities containg LOB attributes
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Alessandro Lazarotti <alazarot>
Component: HibernateAssignee: Brett Meyer <brmeyer>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: alazarot, brmeyer, dstephan, theute
Target Milestone: ---   
Target Release: EAP 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBPAPP6-1220
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
EAP 6 GA
Last Closed: 2012-10-11 16:17:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Entities to reproduce none

Description Alessandro Lazarotti 2012-08-16 21:20:58 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A000000AsSvF&sfdc.override=1
Workaround Description: Renaming the CLOB property to something starting in "zz". This will guarantee that it will be positioned in the final of the statement.
project_key: JBPAPP6

https://hibernate.onjira.com/browse/HHH-4635

Inserting or updating an entity with LOB results in the following error from oracle:

Caused by: java.sql.SQLException: ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column

Fairly confident that the ordering of the LOB attributes is not putting them at the end of the insert or the update. Oracle requires all LOB columns to be the last in the statement.

The Jira HHH-4635 has a test case and a possible fix attached

Comment 1 Brett Meyer 2012-09-18 09:12:59 UTC
Alessandro, I'm working on duplicating this and providing a fix.

Comment 2 Brett Meyer 2012-09-20 10:17:41 UTC
[~alessandrolt] Will you need a one-off for the customer?  This won't be backported until after 4.1.8

Comment 3 Brett Meyer 2012-09-24 16:39:12 UTC
Resolved in https://hibernate.onjira.com/browse/HHH-4635.  Backport on hold until fix confirmed by community.  [~alessandrolt], please let the customer know that the issue will be fixed.  Create a one-off JBPAPP ticket and assign to me, if needed.

Comment 5 Brett Meyer 2012-09-24 17:00:08 UTC
It's not backported to any EAP version yet -- I'd like to wait until the community confirms the fix.  My gut reaction would be EAP6 only, unless a customer requests it in EAP5.

Comment 6 Brett Meyer 2012-10-11 16:17:43 UTC
Release Notes Docs Status: Added: Documented as Resolved Issue
Release Notes Text: Added: Oracle requires Blob/Clob attributes to be the last values in insert and update statements.  Hibernate usually orders attributes alphabetically, so this wasn't always the case.  For Oracle, correct ordering is now enforced.


Comment 7 Brett Meyer 2012-10-11 16:18:20 UTC
Will be in EAP 6.1.0 as a part of the Hibernate component upgrade.  If it's vital to get it sooner, into 6.0.1, let me know.

Comment 8 Anne-Louise Tangring 2012-11-13 20:46:39 UTC
Release Notes Docs Status: Removed: Documented as Resolved Issue 
Release Notes Text: Removed: Oracle requires Blob/Clob attributes to be the last values in insert and update statements.  Hibernate usually orders attributes alphabetically, so this wasn't always the case.  For Oracle, correct ordering is now enforced. 
Docs QE Status: Removed: NEW 


Comment 9 dstephan 2013-11-19 06:38:41 UTC
Created attachment 825909 [details]
Entities to reproduce

Create and persist a SubEntity should reproduce the problem.