code: public void stopTransaction(TransactionWrapper transaction) throws DataAccessException {
          if (logger.isTraceEnabled()) {
              logger.trace("stopTransaction");
          }
          if (transaction==null) {
              if (logger.isTraceEnabled())
                  logger.trace("   ... transaction is null");
              return;
          }
          if (!transaction.isTransactionAlreadyStarted()) {
              DataAccessException exception = null;
              if (!transaction.isDatabaseConnectionAlreadyOpened()) {
                  if (!(db.getConnection() instanceof XAConnection)) {
                      if (transaction.isRollbackOnly()) db.rollback();
                      else {
                          try {
                              db.commit();
                          } catch (SQLException e) {
                              exception = new DataAccessException(0, "Fail to commit", e);
                          }
                      }
                  }
                  db.closeConnection();
              } else {
                  if (logger.isTraceEnabled())
                      logger.trace("   ... database opened by others");
              }
              try {
                  TransactionUtil transUtil = TransactionUtil.getInstance();
                  TransactionManager transManager = transUtil.getTransactionManager();
                  if (transaction.isRollbackOnly()) transManager.rollback();
                  else transManager.commit();
                  transUtil.setCurrentConnection(null);
                  //transUtil.clearCurrentConnection();
              } catch (Exception e) {
                  throw new DataAccessException(0, "Fail to stop the transaction", e);
              }
              if (exception!=null) throw exception;
          } else {
              if (logger.isTraceEnabled())
                  logger.trace("   ... transaction started by others");
          }
      }
docs: Should only be used with MDW data source
  @param transaction