如何调试CMT事务边界? [英] How to debug CMT transaction boundaries?
问题描述
我一直在研究jboss CMT,想了解事务如何自上而下地工作,最好的方法是将调试信息打印到日志文件中,我启用了org.hibernate.SQL,但是,我只得到了从org.hibernate.*级别进行调试时,SQL语句(日志中没有与事务相关的语句的开始"或提交类型)保持不变.
I have been studying jboss CMT , and would like to learn how the transaction works from top to bottom, best way would be printing debug information to the log file, I enabled org.hibernate.SQL , however, i am only getting SQL statement , there is no "begin" nor commit type of the transaction related statement in log, remains the same when debuging from org.hibernate.* level.
做了一些谷歌搜索,答案似乎在调整jbosstx-properties.xml,尝试了一下,也没有帮助.有人可以帮我吗?
Did a little googling, answer seems tweaking jbosstx-properties.xml, tried that, didn't help either. Can anybody help me with this ?
推荐答案
我遵循了第一部分中的建议: http://i-proving.com/2010/05/28/enabling-debug-in-jboss-core/ 基本上告诉您:
I followed the advice found in the first section here: http://i-proving.com/2010/05/28/enabling-debug-in-jboss-core/ which basically tells you to:
设置 "com.arjuna.common.util.logging.DebugLevel" 在 /server//conf/jbossjta-properties.xml 到0xffffffff
Set "com.arjuna.common.util.logging.DebugLevel" in the "common" section of /server//conf/jbossjta-properties.xml to 0xffffffff
并确保您的jboss-log4j配置未过滤掉这些消息.
and make sure your jboss-log4j configuration doesn't filter out these messages.
并开始在日志中获取以下消息:
And started getting these kind of messages in the logs:
15:13:00,276 DEBUG [logger] BaseTransaction.commit
15:13:00,283 DEBUG [logger] BaseTransaction.getStatus
15:13:00,283 DEBUG [logger] BaseTransaction.begin
(还有成千上万的故事,但这是不同的故事.看起来Arjuna/JBoss事务不使用日志记录类别的想法)
(and thousands of others, but that's a different story. It looks like Arjuna/JBoss transactions don't use the logging categories idea)
在JBoss 4.2.3.GA上进行了测试,但是如果您尝试编辑我的JBoss没有的jbosstx-properties.xml
,我想您有一个完全不同的JBoss版本.
Tested on JBoss 4.2.3.GA, but I guess you have a completely different version of JBoss, if you tried editing jbosstx-properties.xml
which my JBoss doesn't have.
这篇关于如何调试CMT事务边界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!