问题
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.
Did a little googling, answer seems tweaking jbosstx-properties.xml, tried that, didn't help either. Can anybody help me with this ?
回答1:
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:
Set "com.arjuna.common.util.logging.DebugLevel" in the "common" section of /server//conf/jbossjta-properties.xml to 0xffffffff
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
(and thousands of others, but that's a different story. It looks like Arjuna/JBoss transactions don't use the logging categories idea)
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.
来源:https://stackoverflow.com/questions/4991242/how-to-debug-cmt-transaction-boundaries