I'm doing a similar thing to this using a SLSB with application scoped @Factory
methods. It works well.
| @Stateless
| @Name("factory")
| public class FactoryActionBean extends BaseActionBean implements
FactoryAction {
| @In(create = true, value = "entityManager")
| protected EntityManager em;
|
| /** [EMAIL PROTECTED] */
| @Factory(value = "statusList", scope = ScopeType.APPLICATION)
| public List<Status> getStatuses() {
| return service.findReservationStatuses(em);
| }
|
Watch out though, using the above list with <s:convertEntity/> broke in Seam 2
Beta 1 due to JBSEAM-1487, but this is now fixed in CVS, thanks to Pete.
"bkroeger" wrote : Hi, I would like to know if Ellen got this working, I have
tried to do the same thing but when I attempt to get a reference to the
EntityManager in my application scope bean:
|
| | @PersistenceContext
| | private EntityManager em;
| |
| I get an error message telling me my bean needs to be in session scope,
which defeats the purpose as I will end up re-creating my list every time a new
session starts.
|
| What's the best way to have an application scope (static) list available to
the application, that requires use of the EntityManager?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060628#4060628
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060628
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user