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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:38:35+00:00 2026-06-04T08:38:35+00:00

When I call merge() on an object, the object does not become managed. Instead

  • 0

When I call merge() on an object, the object does not become managed. Instead a reference to a managed instance of the same entity is returned. What is the logic behind this? Is there a way to change this behavior (and make the object managed) through some settings? I am using OpenJPA 2.2. Thank you.

  • 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-04T08:38:36+00:00Added an answer on June 4, 2026 at 8:38 am

    The point is that merge() is not attaching object to EntityManager context, it is returning attached objects. So, if we have:

    AEntity a2 = entityManager.merge(a1);
    

    a1 remains not managed, while a2 is managed.

    This is, by the way, clever approach since merge does not cause side effects, passed object state is not changed.

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

Sidebar

Related Questions

After a call to merge.xts my resulting time-series object has 3 columns named A.1,
In my EJB project deployed on WAS 6.1, when I try to call EntityManamger.merge(obj),
Call to a possibly undefined method test through a reference with static type Class.
Which call is correct ? Seems that both calls have same result. UIImage *img
I need to merge 2 custom objects of the same type. Here's what the
Question Is it possible to call Word 2003's Tools > Compare and Merge Documents...
In a MVC3-application with Ninject.MVC 2.2.0.3 ( after merge ), instead of injecting repostories
I have an object - call this order This object has a property -
I am writing a JSF 2.0 form to edit a JPA @Entity object. I
My to_json call sometimes seems to include some extra cruft that I'm not expecting:

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.