Author: epbernard
Date: 2010-07-14 14:27:22 -0400 (Wed, 14 Jul 2010)
New Revision: 19949
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/PostTransactionWorkQueueSynchronization.java
Log:
Add trace on transaction before / after completion phases
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/PostTransactionWorkQueueSynchronization.java
===================================================================
---
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/PostTransactionWorkQueueSynchronization.java 2010-07-14
18:26:43 UTC (rev 19948)
+++
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/PostTransactionWorkQueueSynchronization.java 2010-07-14
18:27:22 UTC (rev 19949)
@@ -74,9 +74,14 @@
public void beforeCompletion() {
if ( prepared ) {
- log.trace("This transaction has already been processed, ignoring
beforeCompletion()");
+ if ( log.isTraceEnabled() ) {
+ log.trace("Transaction's beforeCompletion() phase already been processed,
ignoring: {}", this.toString() );
+ }
}
else {
+ if ( log.isTraceEnabled() ) {
+ log.trace("Processing Transaction's beforeCompletion() phase: {}",
this.toString() );
+ }
queueingProcessor.prepareWorks(queue);
prepared = true;
}
@@ -85,9 +90,15 @@
public void afterCompletion(int i) {
try {
if ( Status.STATUS_COMMITTED == i ) {
+ if ( log.isTraceEnabled() ) {
+ log.trace("Processing Transaction's afterCompletion() phase for {}.
Performing work.", this.toString() );
+ }
queueingProcessor.performWorks(queue);
}
else {
+ if ( log.isTraceEnabled() ) {
+ log.trace("Processing Transaction's afterCompletion() phase for {}.
Cancelling work due to transaction status {}", this.toString(), i );
+ }
queueingProcessor.cancelWorks(queue);
}
}