哪个方面/拦截器处理@Transactional注释
有谁知道哪个类处理@Transactional注释?我正在专门寻找创建交易的源代码。
Does anyone know which class handles the @Transactional annotation? I am searching for the source code that creates the transaction, specifically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在这里对 @Transactional 的内容进行了深入的代码分析: http ://doanduyhai.wordpress.com/2011/11/20/spring-transactional-explained/
注意,本次分析仅关注JPA事务。我没有考虑数据库以外的数据源,但我想方法是类似的
I've done a deep code analysis for the @Transactional stuff here: http://doanduyhai.wordpress.com/2011/11/20/spring-transactional-explained/
Be carefull, this analysis only focus on JPA transaction. I did not consider datasources other than database but I guess the approach is similar
TransactionInterceptor< /code>
处理拦截逻辑,但显然需要许多其他基础设施类的帮助。不过,这是最好的起点。当你开始研究源代码时,事务同步的东西是相当可怕的。
@Transactional
的处理,以及将其解析为中性事务描述符对象模型,是由AnnotationTransactionAttributeSource
。TransactionInterceptor
handles the interception logic, but obviously with the assistance of a lot of other infrastructure classes. That's the best place to start, though. The transaction sync stuff is pretty fearsome when you start getting into the source code.The processing of
@Transactional
, and its parsing into the neutral transaction descriptor object model, is done byAnnotationTransactionAttributeSource
.