Does @Transactional open a Session and binds it?
If I annotate a method that is executed in a thread with @Transactional, will a 开发者_高级运维Session be created and bound to the thread?
Yes. The proxy (TransactionInterceptor
) is around the service, so for each invocation of a service method it will start a thread-local transaction.
I would advise you to use spring 3 @Async
so that you leave the thread creation to the container (spring).
精彩评论