title: Transactions In MongoDB
body: <p>I am using a NoSQL database MongoDB  with Java and Spring Data. I am aware that MongoDB only supports transactions for a single document.</p>
  
  <p>I am using Spring Transactions to carry out MongoDB transcations. I am using TransactionTemplate. What should I set in TransactionManager when using TransactionTemplate?</p>
  
  <p>EDIT</p>
  
  <p>I have something like this:</p>
  
  <pre><code>&lt;bean id=”txtTemplateBean” class=”org.springframework.transaction.support.TransactionTemplate”&gt;
  &lt;property name=”transactionManager” ref=”txnManagerBean”&gt;&lt;/property&gt;
  </code></pre>
  
  <p>I need to define txnManagerBean to point to something like DataSourceTransactionManager for a MongoDB database.</p>