Examples of propagation()


Examples of net.hasor.db.transaction.interceptor.simple.Transactional.propagation()

    public Propagation getStrategy(final Method targetMethod) {
        Transactional tranAnno = targetMethod.getAnnotation(Transactional.class);
        if (tranAnno == null) {
            return Propagation.REQUIRED;//默认设置
        }
        return tranAnno.propagation();
    }
}
/**决定隔离级别*/
class IsolationStrategy implements TranStrategy<Isolation> {
    @Override
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional.propagation()

    public void handleTitle(String title) {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"NEVER".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be NEVER propagation");
        }
        if (!tx.readOnly()) {
            throw new IllegalStateException("Should be read only");
        }
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional.propagation()

    public void orderBook(String title) throws Exception {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"REQUIRED".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be REQUIRED propagation");
        }

        if (title.startsWith("Donkey")) {
            throw new IllegalArgumentException("We don't have Donkeys, only Camels");
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional.propagation()

    public void handleTitle(String title) {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"NEVER".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be NEVER propagation");
        }
        if (!tx.readOnly()) {
            throw new IllegalStateException("Should be read only");
        }
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional.propagation()

    public void orderBook(String title) throws Exception {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"REQUIRED".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be REQUIRED propagation");
        }

        if (title.startsWith("Donkey")) {
            throw new IllegalArgumentException("We don't have Donkeys, only Camels");
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional.propagation()

    public void handleTitle(String title) {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"NEVER".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be NEVER propagation");
        }
        if (!tx.readOnly()) {
            throw new IllegalStateException("Should be read only");
        }
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional.propagation()

        Transactional trx = serviceMethod.getAnnotation(Transactional.class);
        Preconditions.checkNotNull(transactionManager,"The method is transactionnal, but no transaction manager was detected!");
        TransactionTemplate trxTpl = new TransactionTemplate(transactionManager);
        trxTpl.setIsolationLevel(trx.isolation().value());
        trxTpl.setReadOnly(trx.readOnly());
        trxTpl.setPropagationBehavior(trx.propagation().value());
        trxTpl.setTimeout(trx.timeout());
        trxTpl.execute(new TransactionCallbackWithoutResult() {
          @Override
          protected void doInTransactionWithoutResult(TransactionStatus status) {
            try {
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional.propagation()

        Transactional trx = serviceMethod.getAnnotation(Transactional.class);
        Preconditions.checkNotNull(transactionManager,"The method is transactionnal, but no transaction manager was detected!");
        TransactionTemplate trxTpl = new TransactionTemplate(transactionManager);
        trxTpl.setIsolationLevel(trx.isolation().value());
        trxTpl.setReadOnly(trx.readOnly());
        trxTpl.setPropagationBehavior(trx.propagation().value());
        trxTpl.setTimeout(trx.timeout());
        trxTpl.execute(new TransactionCallbackWithoutResult() {
          @Override
          protected void doInTransactionWithoutResult(TransactionStatus status) {
            try {
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional.propagation()

        Transactional trx = serviceMethod.getAnnotation(Transactional.class);
        Preconditions.checkNotNull(transactionManager,"The method is transactionnal, but no transaction manager was detected!");
        TransactionTemplate trxTpl = new TransactionTemplate(transactionManager);
        trxTpl.setIsolationLevel(trx.isolation().value());
        trxTpl.setReadOnly(trx.readOnly());
        trxTpl.setPropagationBehavior(trx.propagation().value());
        trxTpl.setTimeout(trx.timeout());
        trxTpl.execute(new TransactionCallbackWithoutResult() {
          @Override
          protected void doInTransactionWithoutResult(TransactionStatus status) {
            try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.