Package org.springframework.transaction.annotation

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


    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

    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

    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

    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

        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

        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

        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.