openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Radhika <radhikagopin...@yahoo.com>
Subject Issue with Update
Date Thu, 06 Aug 2009 17:20:07 GMT

Hi, 

I have an issue with update entity in openjpa. For example, I have a table
Employer , and entity employer and the corresponding DAO is EmployerDAO.


To add a new employer record, I call 
EmployerDAO.save(Employer) which inturn uses
getEntityManager().persist(entity);
This works fine.

Now to update this employer record, I call EmployerDAO.update(Employer)
which in turn calls
getEntityManager().merge(entity).

When I call at my database table, I have 2 records with the same employer
id. For testing purpose, I have disabled the primary key contraints.  At the
same time, I get a JPA exception that I am trying to enter multiple records
with same employer id. 

Why does a new record get created instead of updating a previous one?

Please could you help me out.

Radhika
-- 
View this message in context: http://n2.nabble.com/Issue-with-Update-tp3399573p3399573.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Mime
View raw message