Thx for your response,
I solved it using merge instead of persist :
entityManager.merge(articulo);
//entityManager.persist(articulo);
Hope it helps
On 20 ene, 00:41, -sowdri- <[email protected]> wrote:
> This usually doesn't happen, as the entities with existing id will be only
> merged rather than creating the new instance. Try checking your equals and
> hashcode implementations for 'Articulo' class, as that plays a central role
> in merge mechanism.
>
> If you still want a workaround,
>
> public void persistArticulo(Articulo articulo)
> {
> try {
> EntityManager entityManager = entityManager();
> entityManager.getTransaction().begin();
> // if articule.id != null, merge
> // else persist
> entityManager.persist(articulo);
> entityManager.getTransaction().commit();
> entityManager.close();
> return ;
> }
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.