-
1. Re: Populate pojoCache from Database at startup
pmuir Oct 2, 2006 9:44 AM (in response to rlhr)If you just need a normal EJB entity manager (as opposed to a Seam Managed one) you can use JNDI to look up an EntityManager(Factory).
-
2. Re: Populate pojoCache from Database at startup
rlhr Oct 2, 2006 10:31 AM (in response to rlhr)This is the entityManager I use in the application.
Usually I can inject it using the component name, but in this case, since I have the annotation @Intercept(NEVER), I can't do that.
Actually getting the component with a JNDI look up should work.
I didn't even think of it. I get seam makes a lot of things easy and then I don't even think of the obvious.
Thanks.
Richard -
3. Re: Populate pojoCache from Database at startup
pmuir Oct 2, 2006 10:48 AM (in response to rlhr)The Seam Managed (@In) entity manager is just the extended EJB entity manager but wrapped so you don't get LazyInitialiaztionException in a conversation. Since you are caching (and so I assume the entire object graph for the entity is retrieved?) you should just be able to use a standard, non-extended EJB entity manager.
-
4. Re: Populate pojoCache from Database at startup
rlhr Oct 2, 2006 11:12 AM (in response to rlhr)Yes. There are just data I put in the cache, so I don't need to retrieve them all the time. So what you said will work just fine.