title: Need to understand transaction.factory_class of Hibernate configuration
body: <p>In my hibernate.cfg.xml file, one of the properties is - </p>
  
  <pre><code>&lt;property name = "transaction.factory_class"&gt; &lt;!--1--&gt;
  org.hibernate.transaction.JDBCTransactionFactory &lt;!--2--&gt;
  &lt;/property&gt; &lt;!--3--&gt;
  </code></pre>
  
  <p>Other properties are easy to understand. But, many questions came to my mind when I saw the above property.</p>
  
  <p><strong>line 1 -</strong> this specifies the class implementing the Transaction*<em>Factory</em>* interface.</p>
  
  <p><strong>Q1 -</strong> I saw the java docs for TransactionFactory but did not understand what it really is. What does this "Factory" mean ? Why don't they call it TransactionGenerator as per the line - </p>
  
  <blockquote>
    <p>Contract for generating Hibernate Transaction instances.</p>
  </blockquote>
  
  <p><strong>Q2 -</strong> TransactionFactory lead me to Transaction. Is this exactly the same as a Database transaction ?</p>
  
  <p><strong>Q3 -</strong> </p>
  
  <blockquote>
    <p>A single session might span multiple transactions since the notion of
    a session (a conversation between the application and the datastore)
    is of coarser granularity than the notion of a transaction. However,
    it is intended that there be at most one uncommitted Transaction
    associated with a particular Session at any time.</p>
  </blockquote>
  
  <p><em>...the notion of a session is of coarser granularity than the notion of a transaction.</em></p>
  
  <p>What does that mean in simple words ?</p>
  
  <p>--</p>
  
  <blockquote>
    <p>However, it is intended that there be at most one uncommitted
    Transaction associated with a particular Session at any time.</p>
  </blockquote>
  
  <p>Why do you intend this ?</p>
  
  <p>I don't think that the API docs are clear. Makes a n00b life miserable. </p>