code: public ActivityInstance getActivityInstance(Long pActivityInstId)
      throws ProcessException, DataAccessException {
          TransactionWrapper transaction=null;
          try {
              transaction = startTransaction();
              return engineImpl.getDataAccess().getActivityInstance(pActivityInstId);
          } catch (DataAccessException e) {
              if (canRetryTransaction(e)) {
                  transaction = (TransactionWrapper)initTransactionRetry(transaction);
                  return ((ProcessExecutor)getTransactionRetrier()).getActivityInstance(pActivityInstId);
              }
              else
                  throw e;
          } catch (SQLException e) {
              if (canRetryTransaction(e)) {
                  transaction = (TransactionWrapper)initTransactionRetry(transaction);
                  return ((ProcessExecutor)getTransactionRetrier()).getActivityInstance(pActivityInstId);
              }
              else
                  throw new ProcessException(0, "Failed to get activity instance", e);
          } finally {
              stopTransaction(transaction);
          }
      }
docs: /////////////////////////////////////