Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult


        overdueEndpoint.assertIsSatisfied();
    }

    protected void sendAMessages() {
        TransactionTemplate transaction = getMandatoryBean(TransactionTemplate.class, "transactionTemplate");
        transaction.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                template.sendBody("seda:a", "<hello id='123'>A</hello>");
                template.sendBody("seda:a", "<hello id='124'>B</hello>");
                template.sendBody("seda:a", "<hello id='125'>C</hello>");
            }
View Full Code Here


        });
    }

    protected void sendBMessages() {
        TransactionTemplate transaction = getMandatoryBean(TransactionTemplate.class, "transactionTemplate");
        transaction.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                template.sendBody("seda:b", "<hello id='123'>A</hello>");
                template.sendBody("seda:b", "<hello id='125'>C</hello>");
            }
        });
View Full Code Here

        return this;
    }

    public Processor createActivityProcessor(ActivityBuilder activityBuilder) {
        notNull(jpaTemplate, "jpaTemplate");
        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                processRules.setProcessDefinition(getProcessDefinition());
            }
        });
        return new JpaBamProcessor(getTransactionTemplate(), getJpaTemplate(), activityBuilder.getCorrelationExpression(), activityBuilder.getActivityRules(), getEntityType());
View Full Code Here

                    }
                    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

                    }
                    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

    protected void doInTransactionTemplate(final Exchange exchange) {

        // spring transaction template is working best with rollback if you throw it a runtime exception
        // otherwise it may not rollback messages send to JMS queues etc.

        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                // wrapper exception to throw if the exchange failed
                // IMPORTANT: Must be a runtime exception to let Spring regard it as to do "rollback"
                RuntimeException rce = null;
View Full Code Here

  }

  @Async
  public void doAsyncTask(final Map<Object, Object> context) {
    new TransactionTemplate(transactionManager)
    .execute(new TransactionCallbackWithoutResult(){
      @Override
      protected void doInTransactionWithoutResult(TransactionStatus status) {
          try {
            doTask(context);
          } catch (Exception e) {
View Full Code Here

  /* (non-Javadoc)
   * @see com.apress.prospring.ch12.business.AccountManager#insert(com.apress.prospring.ch12.domain.Account)
   */
  public void insert(final Account account) {
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {

      protected void doInTransactionWithoutResult(TransactionStatus status) {
        doInsert(account);
      }

View Full Code Here

  /* (non-Javadoc)
   * @see com.apress.prospring.ch12.business.AccountManager#deposit(int, java.math.BigDecimal)
   */
  public void deposit(final int accountId, final BigDecimal amount) {
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {

      protected void doInTransactionWithoutResult(TransactionStatus status) {
        doDeposit(accountId, amount);
      }

View Full Code Here

  /* (non-Javadoc)
   * @see com.apress.prospring.ch12.business.AccountManager#transfer(int, int, java.math.BigDecimal)
   */
  public void transfer(final int sourceAccount, final int targetAccount, final BigDecimal amount) {
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {

      protected void doInTransactionWithoutResult(TransactionStatus status) {
        doTransfer(sourceAccount, targetAccount, amount);
      }

View Full Code Here

TOP

Related Classes of org.springframework.transaction.support.TransactionCallbackWithoutResult

Copyright © 2018 www.massapicom. 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.