Example usage for org.springframework.transaction.support TransactionTemplate setName

List of usage examples for org.springframework.transaction.support TransactionTemplate setName

Introduction

In this page you can find the example usage for org.springframework.transaction.support TransactionTemplate setName.

Prototype

public final void setName(String name) 

Source Link

Document

Set the name of this transaction.

Usage

From source file:com.dinstone.jtds.programmatic.ProgrammaticTransactionServiceComponent.java

public void updateUserInfo(final UserInfo user) throws Exception {
    TransactionTemplate transactionTemplate = new TransactionTemplate(txManager);
    transactionTemplate.setName("ProgrammaticTransactionService");

    transactionTemplate.execute(new TransactionCallbackWithoutResult() {

        @Override//from   w  ww.ja  v  a2 s  .  c  om
        protected void doInTransactionWithoutResult(TransactionStatus status) {
            doUpdate(user);
            findUserInfo(user);
            deException(user);
        }

    });

}