• Post Reply Bookmark Topic Watch Topic
  • New Topic

Key already exists exception

 
Venkat Kommareddy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

this is method is in session maintain utility class and session builds when transaction starts.

1. public OpenJPAEntityManager getEntityManager() {
return this.getSession().getEntityManager();
}

below code is calling before merge

2. OpenJPAEntityManager pm = this.getEntityManager(); // will this line giving problem ?

if(this.isDetachable(pm, value.getClass())) {
value = pm.merge(value);
}

I am using 0.9 openjpa version. assigning entity manager from session to another object will create new entity manager object? version id not creating when we try to merge values in (oneToMany relation)
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!