13 Replies Latest reply on Apr 16, 2009 12:28 AM by Stuart Douglas

    Seam and asynchronous threading

    klowtherjr Newbie

      I'm using JBoss 4.2.2GA and Spring/Seam 2.0.2.  I'd like to control the number of threads Seam uses to handle asynchronous requests from JMS.  The requests are being handled by a consumer service which creates events that are handled by these threads as ScheduledFutureTasks.


      The reason I'd like to do this is because I cannot control the number of database connections (for non-technical reasons).  The problem is that if I have 10 threads and 10 database connections, if all of the threads are busy and one needs to commit, another database connection is required to generate IDs.  This causes things to deadlock until a timeout occurs.


      If there is a way to control the number of threads that seems like the best option.  If I can do it by not requiring a new connection for the transaction or some other way, I'm open to ideas there.


      Thanks!


      Ken