Logging refinements for transaction and cache processing (debug/trace)
Issue: SPR-16946
This commit is contained in:
@@ -119,8 +119,8 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
||||
if (txAttr instanceof DefaultTransactionAttribute) {
|
||||
((DefaultTransactionAttribute) txAttr).setDescriptor(methodIdentification);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Adding transactional method '" + methodIdentification + "' with attribute: " + txAttr);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Adding transactional method '" + methodIdentification + "' with attribute: " + txAttr);
|
||||
}
|
||||
this.attributeCache.put(cacheKey, txAttr);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,6 +18,7 @@ package org.springframework.transaction.interceptor;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Spring's common transaction attribute implementation.
|
||||
@@ -82,7 +83,7 @@ public class DefaultTransactionAttribute extends DefaultTransactionDefinition im
|
||||
* to process this specific transaction.
|
||||
* @since 3.0
|
||||
*/
|
||||
public void setQualifier(String qualifier) {
|
||||
public void setQualifier(@Nullable String qualifier) {
|
||||
this.qualifier = qualifier;
|
||||
}
|
||||
|
||||
@@ -141,7 +142,7 @@ public class DefaultTransactionAttribute extends DefaultTransactionDefinition im
|
||||
*/
|
||||
protected final StringBuilder getAttributeDescription() {
|
||||
StringBuilder result = getDefinitionDescription();
|
||||
if (this.qualifier != null) {
|
||||
if (StringUtils.hasText(this.qualifier)) {
|
||||
result.append("; '").append(this.qualifier).append("'");
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -132,7 +132,7 @@ public class DefaultTransactionStatus extends AbstractTransactionStatus {
|
||||
/**
|
||||
* Return whether the progress of this transaction is debugged. This is used
|
||||
* by AbstractPlatformTransactionManager as an optimization, to prevent repeated
|
||||
* calls to logger.isDebug(). Not really intended for client code.
|
||||
* calls to {@code logger.isDebug()}. Not really intended for client code.
|
||||
*/
|
||||
public boolean isDebug() {
|
||||
return this.debug;
|
||||
|
||||
Reference in New Issue
Block a user