本文整理了Java中org.springframework.transaction.annotation.Transactional.propagation()
方法的一些代码示例,展示了Transactional.propagation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transactional.propagation()
方法的具体详情如下:
包路径:org.springframework.transaction.annotation.Transactional
类名称:Transactional
方法名:propagation
暂无
代码示例来源:origin: liuyangming/ByteTCC
private void validateTransactionalPropagation(Method method, Class<?> clazz) throws IllegalStateException {
Transactional transactional = method.getAnnotation(Transactional.class);
if (transactional == null) {
Class<?> declaringClass = method.getDeclaringClass();
transactional = declaringClass.getAnnotation(Transactional.class);
}
if (transactional == null) {
throw new IllegalStateException(String.format("Method(%s) must be specificed a Transactional annotation!", method));
}
Propagation propagation = transactional.propagation();
if (Propagation.REQUIRED.equals(propagation) == false //
&& Propagation.MANDATORY.equals(propagation) == false //
&& Propagation.REQUIRES_NEW.equals(propagation) == false) {
throw new IllegalStateException(
String.format("Method(%s) not support propagation level: %s!", method, propagation.name()));
}
}
代码示例来源:origin: liuyangming/ByteTCC
Propagation propagation = transactional == null ? null : transactional.propagation();
if (propagation == null) {
compensable.registerCompensable(invocation);
代码示例来源:origin: com.mysema.rdf/rdfbean-tapestry
private boolean isIntercepted(Transactional annotation) {
switch (annotation.propagation()) {
case NOT_SUPPORTED:
case NEVER:
case SUPPORTS:
return false;
default:
return true;
}
}
代码示例来源:origin: com.mysema.rdf/rdfbean-guice
private boolean handle(Method method, Transactional annotation) {
boolean intercepted = annotation.propagation() != Propagation.SUPPORTS;
if (intercepted) {
configuration.put(method, annotation);
}
return intercepted;
}
代码示例来源:origin: org.apache.aries.blueprint/blueprint-maven-plugin-spring-handlers
private String getTransactionTypeName(Transactional transactional) {
Propagation propagation = transactional.propagation();
if (propagation == Propagation.NESTED) {
throw new UnsupportedOperationException("Nested transactions not supported");
}
return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, propagation.name());
}
代码示例来源:origin: com.mysema.rdf/rdfbean-guice
private boolean isIntercepted(Transactional annotation, boolean inTx) {
switch (annotation.propagation()) {
case REQUIRED:
case REQUIRES_NEW:
case NESTED:
if (inTx) {
return false;
}
break;
case MANDATORY:
if (inTx) {
return false;
} else {
throw new TxException("Tx propagation " + annotation.propagation() + " without transaction");
}
case NOT_SUPPORTED:
case NEVER:
if (inTx) {
throw new TxException("Tx propagation " + annotation.propagation() + " in transaction");
} else {
return false;
}
}
return true;
}
代码示例来源:origin: org.bytesoft/bytetcc-supports
private void validateTransactionalPropagation(Method method, Class<?> clazz) throws IllegalStateException {
Transactional transactional = method.getAnnotation(Transactional.class);
if (transactional == null) {
Class<?> declaringClass = method.getDeclaringClass();
transactional = declaringClass.getAnnotation(Transactional.class);
}
if (transactional == null) {
throw new IllegalStateException(String.format("Method(%s) must be specificed a Transactional annotation!", method));
}
Propagation propagation = transactional.propagation();
if (Propagation.REQUIRED.equals(propagation) == false //
&& Propagation.MANDATORY.equals(propagation) == false //
&& Propagation.SUPPORTS.equals(propagation) == false //
&& Propagation.REQUIRES_NEW.equals(propagation) == false) {
throw new IllegalStateException(
String.format("Method(%s) not support propagation level: %s!", method, propagation.name()));
}
}
代码示例来源:origin: com.butor/butor-web
trxTpl.setIsolationLevel(trx.isolation().value());
trxTpl.setReadOnly(trx.readOnly());
trxTpl.setPropagationBehavior(trx.propagation().value());
trxTpl.setTimeout(trx.timeout());
代码示例来源:origin: jeffreyning/nh-micro
def.setPropagationBehavior(trans.propagation().value());
TransactionStatus status=transactionManager.getTransaction(def);
try
代码示例来源:origin: jeffreyning/nh-micro
def.setPropagationBehavior(trans.propagation().value());
TransactionStatus status=transactionManager.getTransaction(def);
try
代码示例来源:origin: org.bytesoft/bytetcc-supports
Propagation propagation = transactional == null ? null : transactional.propagation();
if (propagation == null) {
compensable.registerCompensable(invocation);
代码示例来源:origin: com.butor/butor-web
trxTpl.setIsolationLevel(trx.isolation().value());
trxTpl.setReadOnly(trx.readOnly());
trxTpl.setPropagationBehavior(trx.propagation().value());
trxTpl.setTimeout(trx.timeout());
代码示例来源:origin: com.butor/butor-web
trxTpl.setIsolationLevel(trx.isolation().value());
trxTpl.setReadOnly(trx.readOnly());
trxTpl.setPropagationBehavior(trx.propagation().value());
trxTpl.setTimeout(trx.timeout());
内容来源于网络,如有侵权,请联系作者删除!