1 Reply Latest reply on Aug 16, 2006 1:44 AM by wondermike

    How to get rid of an object within a scope from within a ses

    smokingapipe

      Here's the problem: Like so many other applications, I have a page that lets users sign up. Like all other Seam apps, I have a session bean that processes these signups. If everything is ok, it calls entityManager.persist(user).

      That's great. Here's the problem: Let's say some silly user does that, and then goes back to that same page, and signs up again. Not a normal use of the system, but it will happen and it shouldn't throw an error. But it does throw an error, because it's using the same User object, which has already been persisted. So it tries to persist a detached object, which is an error.

      What's the solution to this?

      Thanks