Package org.springframework.transaction.annotation

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


     * @return referred stored bean.
     * @throws UnresolvedReferenceException in case of failures, read-only methods and unresolved bean.
     */
    public T resolveBeanReference(final Method method, final Object... args) throws UnresolvedReferenceException {
        final Transactional transactional = method.getAnnotation(Transactional.class);
        if (transactional != null && transactional.readOnly()) {
            throw new UnresolvedReferenceException();
        }
        return resolveReference(method, args);
    }

View Full Code Here


            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");
        }

        if (!title.contains("in Action")) {
            throw new IllegalArgumentException("Not a book title we like");
View Full Code Here

            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");
        }

        if (!title.contains("in Action")) {
            throw new IllegalArgumentException("Not a book title we like");
View Full Code Here

            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");
        }

        if (!title.contains("in Action")) {
            throw new IllegalArgumentException("Not a book title we like");
View Full Code Here

      if (serviceMethod.isAnnotationPresent(Transactional.class)) {
        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) {
View Full Code Here

     * @return referred stored bean.
     * @throws UnresolvedReferenceException in case of failures, read-only methods and unresolved bean.
     */
    public T resolveBeanReference(final Method method, final Object... args) throws UnresolvedReferenceException {
        final Transactional transactional = method.getAnnotation(Transactional.class);
        if (transactional != null && transactional.readOnly()) {
            throw new UnresolvedReferenceException();
        }
        return resolveReference(method, args);
    }

View Full Code Here

      if (serviceMethod.isAnnotationPresent(Transactional.class)) {
        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) {
View Full Code Here

      if (serviceMethod.isAnnotationPresent(Transactional.class)) {
        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) {
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.