IBM Support

PI93064: ECLIPSELINK THROWS ORA-00932 FOR CLOB FIELDS IN AN ELEMENTCOLLECTION

Fixes are available

18.0.0.2: WebSphere Application Server Liberty 18.0.0.2
18.0.0.3: WebSphere Application Server Liberty 18.0.0.3
18.0.0.4: WebSphere Application Server Liberty 18.0.0.4
19.0.0.1: WebSphere Application Server Liberty 19.0.0.1
19.0.0.2: WebSphere Application Server Liberty 19.0.0.2
19.0.0.3: WebSphere Application Server Liberty 19.0.0.3
19.0.0.4: WebSphere Application Server Liberty 19.0.0.4
19.0.0.5: WebSphere Application Server Liberty 19.0.0.5
19.0.0.6: WebSphere Application Server Liberty 19.0.0.6
19.0.0.7: WebSphere Application Server Liberty 19.0.0.7
19.0.0.8: WebSphere Application Server Liberty 19.0.0.8
19.0.0.9: WebSphere Application Server Liberty 19.0.0.9
19.0.0.10: WebSphere Application Server Liberty 19.0.0.10
19.0.0.11: WebSphere Application Server Liberty 19.0.0.11
19.0.0.12: WebSphere Application Server Liberty 19.0.0.12
20.0.0.1: WebSphere Application Server Liberty 20.0.0.1
20.0.0.2: WebSphere Application Server Liberty 20.0.0.2
20.0.0.3: WebSphere Application Server Liberty 20.0.0.3
20.0.0.4: WebSphere Application Server Liberty 20.0.0.4
20.0.0.5: WebSphere Application Server Liberty 20.0.0.5
20.0.0.6: WebSphere Application Server Liberty 20.0.0.6
20.0.0.7: WebSphere Application Server Liberty 20.0.0.7
20.0.0.8: WebSphere Application Server Liberty 20.0.0.8
20.0.0.9: WebSphere Application Server Liberty 20.0.0.9
20.0.0.10: WebSphere Application Server Liberty 20.0.0.10
20.0.0.11: WebSphere Application Server Liberty 20.0.0.11
20.0.0.12: WebSphere Application Server Liberty 20.0.0.12
21.0.0.3: WebSphere Application Server Liberty 21.0.0.3
21.0.0.4: WebSphere Application Server Liberty 21.0.0.4
21.0.0.5: WebSphere Application Server Liberty 21.0.0.5
21.0.0.6: WebSphere Application Server Liberty 21.0.0.6
21.0.0.7: WebSphere Application Server Liberty 21.0.0.7
21.0.0.8: WebSphere Application Server Liberty 21.0.0.8
21.0.0.9: WebSphere Application Server Liberty 21.0.0.9

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When removing @Embeddable objects from an @ElementCollection
    that contain fields of type CLOB, EclipseLink will construct
    queries that contain CLOB field types in WHERE clauses. This
    is
    not valid for Oracle databases and will result in an
    ORA-00932
    exception. This APAR adds support to the EclipseLink
    persistence provider for CLOB field types in
    ElementCollections.
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty - Java Persistence APA - JPA *
    *                  2.1 & EclipseLink & Oracle                  *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink creates a DELETE statement  *
    *                      containing CLOB fields, which throws    *
    *                      exception ORA-00932 on Oracle DB        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Example JPA Entity mapping:
    
        @Embeddable
        public class CollectedEntity {
            @Lob
            @Column(name = "content", nullable = false)
            private String content;
        }
    
        @Entity
        public class ParentEntity {
            @ElementCollection(fetch = FetchType.EAGER)
            @CollectionTable(
                joinColumns = {
                    @JoinColumn(name = "parent_id",
    referencedColumnName = "id"),
                    @JoinColumn(name = "parent_version",
    referencedColumnName = "version")
                })
            private Set<CollectedEntity> subs;
        }
    
    Observe in this example that the @ElementCollection,
    Set<CollectedEntity>, has a @Lob field. If the application code
    performs a removal from this Set and attempts to merge the
    entity back to the persistence context, EclipseLink will
    construct a DELETE query to remove from ParentEntity. For
    instance:
    
        em = emf.createEntityManager();
    
        final Set<CollectedEntity> col1 = new
    HashSet<CollectedEntity>(
            Arrays.asList(new CollectedEntity[] {
                new CollectedEntity("label1", "content1"),
                new CollectedEntity("label2", "content2"),
                new CollectedEntity("label3", "content3") }));
    
        final ParentEntity pdo = new ParentEntity(9,
    Collections.unmodifiableSet(col1));
        em.getTransaction().begin();
        em.persist(pdo);
        em.getTransaction().commit();
    
        final Set<CollectedEntity> col2 = new
    HashSet<CollectedEntity>(
                        Arrays.asList(new CollectedEntity[] {
                                new CollectedEntity("label1",
    "content1"),
                                new CollectedEntity("label2",
    "content2") }));
        final ParentEntity newEntity = new ParentEntity(pdo.getId(),
    col2);
    
        try {
            em.getTransaction().begin();
            //Failure would occur on merge with EclipseLink
    construction and execution of DELETE statement
            em.merge(newEntity);
            em.getTransaction().commit();
        } catch (final Exception e) { ... }
    
    
    Exception:
    
    Exception [EclipseLink-4002] (Eclipse Persistence Services -
    3.0.0.qualifier):
    org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00932:
    inconsistent datatypes: expected - got CLOB
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PI93064

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    CD0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-01-29

  • Closed date

    2018-05-08

  • Last modified date

    2018-05-08

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • RCD0 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"CD0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
24 November 2021