session, Transaction and worker threads
We are currently using Spring + webwork + Hibernate with the OpenSessionInViewFilter. Everything works great when confined to a single request. However, we now have to implement some long running processes that will be submitted by users of our app.
We were going to have spring wire up our services with daos, which would then be used by worker threads that the services started. However, we have no idea what this does to the opening/closing od sessions or the transaction demarcation.
Currently our transaction are demarcated declaratively around a single request. Our worker threads will need to make commits to the database several times over thie lifetime. What is the proper way of doing this?
Should we provide our service with a transaction manager? Which one? Should the threads open/close sessions themselves? Does each thread need its own unique dao, session, transaction???
thanks