users@glassfish.java.net

Cannot persist detached object

From: <glassfish_at_javadesktop.org>
Date: Tue, 11 Dec 2007 12:38:33 PST

Hi,

I have deployed a stateless session bean that has both remote and local interfaces.

Here is how I defined the SLSB

@Stateless(name="FingerprintImage")
public class FingerprintImageBean implements FingerprintImage,
                                             FingerprintImageLocal {
...

I am calling the below in my standalone client.

...
            FingerprintImage fingerprintImage = (FingerprintImage)context.lookup("java:comp/env/ejb/FingerprintImage");
..
IdtIsrs idtisrs = new IdtIsrs();
...
fingerprintImage.persistEntity(idtisrs);


I am getting below exception from my standalone client.

Class> gov.dhs.visit.ident.dal.jpa.entity.IdtIsrs Primary Key> [7]; nested exception is:
        javax.persistence.EntityExistsException:
Exception Description: Cannot persist detached object [gov.dhs.visit.ident.dal.jpa.entity.IdtIsrs_at_213544].

I would appreciate if you could let me know what I am doing wrong.

Thanks,

Mustafa
[Message sent by forum member 'mcayci' (mcayci)]

http://forums.java.net/jive/thread.jspa?messageID=249582