Examples of TransactionTemplate


Examples of org.springframework.transaction.support.TransactionTemplate

                    try {
                        Thread.sleep((long) (Math.random() * SLEEP));
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    TransactionTemplate tt = new TransactionTemplate(this.txManager);


                    try {
                        tt.execute(new TransactionCallbackWithoutResult() {
                            @Override
                            protected void doInTransactionWithoutResult(TransactionStatus status) {
                                try {

                                    for (final String queue : QUEUES) {
View Full Code Here

Examples of org.springframework.transaction.support.TransactionTemplate

    this.transactionPropagation = transactionPropagation;
  }
 
  @SuppressWarnings("unchecked")
  public <T> T execute(final Command<T> command) {
    TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager);
    transactionTemplate.setPropagationBehavior(transactionPropagation);
    T result = (T) transactionTemplate.execute(new TransactionCallback() {
      public Object doInTransaction(TransactionStatus status) {
        return next.execute(command);
      }
    });
    return result;
View Full Code Here

Examples of org.springframework.transaction.support.TransactionTemplate

            }

            if (transactionTemplate == null) {
                Map<String, PlatformTransactionManager> map = routeContext.lookupByType(PlatformTransactionManager.class);
                if (map != null && map.size() == 1) {
                    transactionTemplate = new TransactionTemplate(map.values().iterator().next());
                } else if (LOG.isDebugEnabled()) {
                    if (map == null || map.isEmpty()) {
                        LOG.trace("No PlatformTransactionManager found in registry.");
                    } else {
                        LOG.debug("Found " + map.size() + " PlatformTransactionManager in registry. "
View Full Code Here

Examples of org.springframework.transaction.support.TransactionTemplate

    public void setSpringTransactionPolicy(SpringTransactionPolicy policy) {
        this.transactionTemplate = policy.getTransactionTemplate();
    }

    public void setTransactionManager(PlatformTransactionManager transactionManager) {
        this.transactionTemplate = new TransactionTemplate(transactionManager);
    }
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.