开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜