title: Determine if SQLite3 transaction is active
body: <p>I am running an <code>END TRANSACTION</code> on my database and occasionally I get error</p>
  
  <blockquote>
    <p>#1 that "cannot commit - no transaction is active"</p>
  </blockquote>
  
  <p>Is there a way to determine if a transaction is active before trying a commit? I have been tracking my <code>"BEGIN TRANSACTIONS"</code> by hand but I feel there is a better way.</p>
  
  <p>I am using the C API</p>