title: Shouldn't nHibernate ISession.BeginTransaction() fail when a transaction is already open?
body: <p>I know these kinds of questions can lead to flame wars. Personally I'm a huge fan of nHibernate and I realize no ORM is perfect. I'm just trying to determine if there's a good reason for this I'm unaware of or if it's a design flaw that exists because changing it would break existing code.</p>
  
  <p>Here's the behavior I'm describing:</p>
  
  <p>Assuming I have an existing <code>ISession</code> named <code>session</code> shouldn't the following code throw an exception on the third line due to the fact that nHibernate does not support nested transactions.</p>
  
  <pre><code>ITransaction tx = null;
  tx = session.BeginTransaction();
  tx = session.BeginTransaction();
  </code></pre>
  
  <p>If we assume that there are no other transactions open on the current thread the first call to <code>BeginTransaction()</code> does indeed begin a transaction. However the <em>second</em> merely returns the existing transaction. It <em>gives the impression</em> that nested transactions are supported. Is this bad nomenclature?</p>
  
  <p>Would it make more sense to create two methods? One for grabbing an existing transaction <em>or</em> creating one if none exists in situations where the developer doesn't care and another method that <em>specifically</em> creates new transactions and fails when it cannot?</p>
  
  <p>This question is about nHibernate but perhaps this applies to Hibernate as well.</p>