That looks like a programming error on your part. If you don't understand
what the error message is saying, then you should read up on general JPA
concepts to get a better idea of how to manage your entities.

To me, it looks a lot like a very common error: storing a User entity in
the HTTP session. When you put that entity in the HTTP session, it becomes
detached at the end of the request cycle. If you really want to store the
User entity itself in the HTTP session then you'll have to reattach it to
the current JPA session (with EntityManager#merge) for each request. The
simpler approach is to store the User's ID in the session instead and
provide a getUser() in your base ActionBean or ActionBeanContext
implementation that looks up the entity by ID.

-Ben

On Mon, Jun 4, 2012 at 1:41 PM, Geert Van Muylem <
[email protected]> wrote:

> Hi,
>
> If I switch to a <non-jta-data-source>java:/MarketPlaceDS
> </non-jta-data-source>
>
> I get in the Stripersist.getEntityManager(PERSISTENCEUNIT).persist(object);
> the following error
> 9:33:42,851 ERROR [org.apache.catalina.core.ContainerBase.
> [jboss.web].[localhost].[/MarketPlace].[StripesDispatcher]]
> Servlet.service() for servlet StripesDispatcher threw exception:
> org.hibernate.PersistentObjectException:
> detached entity passed to persist: be.zetes.marketplace.entity.User at
>
> org.hibernate.event.def.DefaultPersistEventListener.onPersist
>
> DefaultPersistEventListener.java:127) [:3.6.2.Final]
>
> Geert
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to