transactions - Spring @Transactional value param with SpEL (Spring expression language) -
in 1 of service classes have methods annotated such :
@transactional(value="foodb") public bar getmesomething(){ }
i learned @value power of spring el values stored in properties file. such
@value("${my.db.name}")
which works charm.
now i'm trying same with
@transactional(value="${my.db.name}")
with no success ...
i following exception :
org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named '${my.db.name}' defined: no matching platformtransactionmanager bean found qualifier '${my.db.name}' - neither qualifier match nor bean name match!
is trying supported spring ?
what can my.db.name value inside @transactional annotation
thanks
nope, it's not supported.
here's excerpt org.springframework.transaction.annotation.springtransactionannotationparser
public transactionattribute parsetransactionannotation(transactional ann) { rulebasedtransactionattribute rbta = new rulebasedtransactionattribute(); rbta.setpropagationbehavior(ann.propagation().value()); rbta.setisolationlevel(ann.isolation().value()); rbta.settimeout(ann.timeout()); rbta.setreadonly(ann.readonly()); rbta.setqualifier(ann.value()); // <<--- magic // if there, isn't
Comments
Post a Comment