Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7555621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:39:24+00:00 2026-05-30T11:39:24+00:00

Using EclipseLink 2.3.2 with static weaving (Maven plugin) against OracleXE. I have the following

  • 0

Using EclipseLink 2.3.2 with static weaving (Maven plugin) against OracleXE.

I have the following Entity

@Entity
@Table(name="LIST")
public class List {

    ...Id...

    @ElementCollection(fetch = FetchType.EAGER)
    @CollectionTable(name = "LIST_CONTENTS", joinColumns = @JoinColumn(name = "LIST_ID"))
    @OrderColumn(name = "SEQ")
    @Column(name = "CONTENT", length = 4000)
    private java.util.List<String> contents;

}

and when I update the contents by doing the following:

// newContents is a String[]
em.getTransaction().begin();
List list = em.find(List.class,id);
list.setContents(new ArrayList<String>(Arrays.asList(newContents)));
em.getTransaction().commit();

I get a duplicate key error – like it didn’t delete the old data

> Error Code: 1 Call: INSERT INTO NIBR_LIST_CONTENTS (LIST_ID, CONTENT,
> SEQ) VALUES (?, ?, ?)
>         bind => [3 parameters bound] Query: DataModifyQuery(sql="INSERT INTO NIBR_LIST_CONTENTS (LIST_ID, CONTENT,
> SEQ) VALUES (?, ?, ?)")
>         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
>         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
>         at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:512)
>         ... 54 more Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461):
> org.eclipse.persistence.exceptions.DatabaseException Internal
> Exception: java.sql.SQLIntegrityConstraintViolationException:
> ORA-00001: unique constraint (ANNEX.NIBR_LIST_CONTENTS_PK) violated
> 
> Error Code: 1 Call: INSERT INTO NIBR_LIST_CONTENTS (LIST_ID, CONTENT,
> SEQ) VALUES (?, ?, ?)
>         bind => [3 parameters bound] Query: DataModifyQuery(sql="INSERT INTO NIBR_LIST_CONTENTS (LIST_ID, CONTENT,
> SEQ) VALUES (?, ?, ?)")
>         at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
>         at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:840)
>         at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:906)
>         at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:592)
>         at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535)
>         at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1717)
>         at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:253)
>         at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
>         at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
>         at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:236)
>         at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:216)
>         at org.eclipse.persistence.internal.queries.StatementQueryMechanism.executeNoSelect(StatementQueryMechanism.java:115)
>         at org.eclipse.persistence.queries.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:85)
>         at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844)
>         at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:743)
>         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
>         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516)
>         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498)
>         at org.eclipse.persistence.mappings.DirectCollectionMapping.performDataModificationEvent(DirectCollectionMapping.java:2080)
>         at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:157)
>         at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3799)
>         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1415)
>         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:636)
>         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1505)
>         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:267)
>         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
>         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
>         ... 56 more Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique
> constraint (ANNEX.NIBR_LIST_CONTENTS_PK) violated
> 
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
>         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
>         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
>         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
>         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
>         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
>         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1010)
>         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
>         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
>         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3657)
>         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
>         at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:831)
>         ... 81 more

I’ve no idea what’s wrong in the setup – I am using flyway to execute the SQL/DDL that I’ve written by hand. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:39:25+00:00Added an answer on May 30, 2026 at 11:39 am

    Based on how EclipseLink processes the elements of the ElementCollection (order), you cannot have a primary key of the join columns and the order column. EclipseLink does handle updates properly with SQL that may or may not include the sequence column, but the order is such that the same LIST_ID, SEQ combination can exist for the same time in the transaction.

    Remove the primary key and it all works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have entity model like this (using EclipseLink and JPA 2.0): @Entity class A
Using Eclipselink/MOXy 2.3 i have following usecase in marshalling to XML: abstract class MyAbstract
I am using eclipselink, and I have the following code to call a stored
I have following use-case for marshalling a POJO to XML using Eclipselink MOXy 2.3:
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
We are using Eclipselink for ORM, but we have a need for some more
I have run into a EclipseLink issue with multiple queries running against the DB
I'm using EclipseLink in Glassfish with my JavaEE application and have some java.util.Locale-columns in
I'm using the latest EclipseLink version with MySQL 5.5 (table type InnoDB). I'm inserting
I'm using EclipseLink as the JPA provider. Further I'm using the following TABLE_PER_CLASS inheritance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.