title: In Scalar DB, can I leave a Transaction as is if I don't need it or do I need to do some clean up
body: <p>The question is about Scalar DB (<a href="https://github.com/scalar-labs/scalardb" rel="nofollow noreferrer">https://github.com/scalar-labs/scalardb</a>). In the following code, I check if a user exists. If it does, I throw an exception. If it doesn't I go about adding it in tables. I am creating a DistributedTransaction instance at the beginning and am using it in all transactions.</p>
  <pre><code>val transaction: DistributedTransaction = transactionService.start
  logger.trace(&quot;transaction started: &quot; + transaction);
  //Perform the operations you want to group in the transaction
  val userExists:Boolean = userShouldNotExist(transaction,userKey)
  if(!userExists) {
    userTransactionRepository.addUser(transaction, user)
    userProfileAndPortfolioTransactionRepository.addUserProfileAndPortfolio(transaction, user)
    userTokenTransactionRepository.addToken(transaction, emailToken, user)
    commitTransaction(transaction)
    (user: User, profileAndPortfolio: ExternalUserProfile, emailToken: UserToken)
  } else {
    throw DuplicateUserException(user)
  }
  </code></pre>
  <p>If the else block, do I need to do some cleanup/finalisation with DistributedTransaction or can I just leave it as is?</p>