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 8876397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:12:17+00:00 2026-06-14T19:12:17+00:00

I get the exception when trying to merge an entity whose Id matches the

  • 0

I get the exception when trying to merge an entity whose Id matches the corresponding datastore entity already in HBase:

javax.persistence.PersistenceException: Object "ai.ilikeplaces.entities.Wall@4aaf0d" being inserted has id "12653" yet an object with this id already exists in the datastore!
        at org.datanucleus.api.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:30
2)
        at org.datanucleus.api.jpa.JPAEntityManager.merge(JPAEntityManager.java:568)
        at ai.ilikeplaces.util.cache.AbstractHCMapStore.store(AbstractHCMapStore.java:39)
        at ai.ilikeplaces.logic.crud.hazelcast.HazelcastWallMapStore.store(HazelcastWallMapStore.java:20)
        at com.hazelcast.impl.concurrentmap.MapStoreWrapper.store(MapStoreWrapper.java:110)
        at com.hazelcast.impl.CMap$1.run(CMap.java:994)
        at com.hazelcast.impl.executor.ParallelExecutorService$ParallelExecutorImpl$ExecutionSegment.run(ParallelExecutorService.java:212)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
Caused by: org.datanucleus.exceptions.NucleusUserException: Object "ai.ilikeplaces.entities.Wall@4aaf0d" being inserted has id "12653" yet an object with this id already exists in the datastore!
        at org.datanucleus.store.hbase.HBasePersistenceHandler.insertObject(HBasePersistenceHandler.java:129)
        at org.datanucleus.state.JDOStateManager.internalMakePersistent(JDOStateManager.java:2371)
        at org.datanucleus.state.JDOStateManager.makePersistent(JDOStateManager.java:2347)
        at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1798)
        at org.datanucleus.ObjectManagerImpl.persistObjectWork(ObjectManagerImpl.java:1647)
        at org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1504)
        at org.datanucleus.api.jpa.JPAEntityManager.merge(JPAEntityManager.java:564)
        ... 8 more

When attempting to merge an entity.

The code related to this exception is:

        System.out.println("Attempting to store data:" + value);
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("adimpression_ilikeplaces_war_1.6-SNAPSHOTPU_DN");
        System.out.println("Obtained EntityManagerFactory.");

        EntityManager em = emf.createEntityManager();
        System.out.println("Obtained EntityManager.");

        em.getTransaction().begin();
        System.out.println("Began Transaction.");

        em.merge(value);

        System.out.println("Persisted data.");

        em.getTransaction().commit();
        System.out.println("Committed Transaction");

where

em.merge(value);

is line 39. That is AbstractHCMapStore.java:39 .

The entity I am trying to merge is a new entity, i.e. created with java new keyword and not fetched from database previously.

Any help would be greatly appreciated.

Thanks in advance!

  • 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-06-14T19:12:18+00:00Added an answer on June 14, 2026 at 7:12 pm

    Set datanucleus.allowAttachOfTransient=true in persistence.xml if you’re trying to merge a serialized object

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

Sidebar

Related Questions

I am trying to get around a Cross Thread Exception, Invalid Object Exception. Here
I get the following exception when trying to access any nodes of a parsed
In a Spring + Hibernate + JTA project I'm trying to get exception handling
I'm trying the basic jMonkey but I get this exception jun 27, 2012 9:25:08
I am trying to get my head over MERGE sql statement. What I want
I get an exception when trying to decompress a (.gz) file using the GZipStream
I get this exception when trying to save my context: unrecognized selector sent to
I've got a folder: c:\test I'm trying this code: File.Move(@c:\test\SomeFile.txt, @c:\test\Test); I get exception:
I am trying to merge an object which has 4 properties (ID, FIRSTNAME, LASTNAME,
I get an exception trying to save a picture on a CameraCaptureTask callback. Why

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.