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 view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/_NGllC_TidUJ.
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.

Reply via email to