title: Multidocument transactions using doctine-odm for mongodb
body: <p><a href="https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/2.2/index.html" rel="nofollow noreferrer">doctine-odm</a> does not support native strategy for multi document transaction support as per this <a href="https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/2.2/reference/transactions-and-concurrency.html#limitation" rel="nofollow noreferrer">document</a></p>
  <p>However, does anyone have figured out a workaround?</p>
  <p>According to mongodb, we need to create a session and pass it to every query in the transaction to take control over full commit  rollback. <a href="https://zgadzaj.com/development/mongodb/mongodb-multi-document-transactions-in-symfony-4-with-doctrine-and-mongodb-odm-bundle" rel="nofollow noreferrer">this</a> implementation does the same thing but it does not work. I get error while passing session to the <code>-&gt;flush()</code> method.</p>
  <p><strong>Error</strong>
  <code>The \&quot;writeConcern\&quot; option cannot be specified within a transaction. Instead, specify it when starting the transaction.</code></p>