This is probably more of an EJB3 question than a Seam question but I figured I would ask anyway. In my Seam application I want to create a pool of threads that periodically run some background chores. These threads will have to access the DB through JPA/Hibernate. Is there ay restriction that the thread doing JPA access belong to an active user session or can they be application's background threads?
I have previously tried launching asynchronous tasks where a user request kicks off a thread that does the DB job in the background. I gave that up because of too many transaction related exceptions.
If someone has more thoughts on this topic or can point me to documentation that describes launching asynchronous tasks in Seam/EJB3, I would really appreciate it.
Thanks.
-Raj
There is a chapter in the docs on this, basically you just add @Asyncronous to your method that you want to run in the background