1 Reply Latest reply on Jan 16, 2009 3:50 AM by Stuart Douglas

    How to run background tasks

    Raj Tiwari Newbie

      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