[jboss-user] [JBoss Seam] - Re: Seam-Managed Persistence Context

pete.muir@jboss.org do-not-reply at jboss.com
Tue Sep 4 12:33:36 EDT 2007


"rjstanford" wrote : Would I be better off simply storing the ID in session scope and doing a factory every time?  That seems a little intensive, but at the same time I don't want to have to create an action for every page just to create a persistence context to merge() the currentUser object to.

This would be my approach, but it depends on how often you need the currentUser object - bear in mind that the object is probably in the Hibernate 2nd level cache anyway.  It will also play nice with all your other objects in this scenario.  Otherwise you can create a SESSION scoped SMPC (just set the scope in components.xml) - but it will be a different SMPC from your normal one, so you'll get exceptions if you try to manage the wrong object in the wrong PC.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080979#4080979

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080979



More information about the jboss-user mailing list