Connection leaking happened in my case(wcf environment), when a
unhanlded exception was thrown and the session never got disposed.
I've not seen any other side effects, besides that you need to
configure the connection release mode to on_close since distributed
transaction can commit on a different thread, and you must make sure
the session is still available. If you read the comments on davy's
blog post, you will find the pattern I use.

Like Fabio said, the distributed txn factory is used by default, so no
configuration changes shoul be needed. My recommendation is that you
check the version of odp.net you are running, and check the connection
string documentation for oracle since I think there is a Parm that
might need to be turned on. With dist. Txn, if you want to rollback,
either throw an exception or call the transactionscope.dispose(). Also
cover all your bases, check that meets is running and check the
statistics to make sure txns are being generated

On Dec 3, 3:30 pm, rodri_ogri <[email protected]> wrote:
> B.T.W, I have previously saw an issue regarding to leaking connections
> on this 
> site:http://davybrion.com/blog/2010/05/avoiding-leaking-connections-with-n...
>
> The autor states that is order to avoid the leak when using
> transactionScope (which is my case) the transactionscope instance
> should be surrounding a NH Transaction, otherwise it will consume the
> connection pool. Now, I'm not sure if that recomendation is the best
> practice, but I find it interesting to comment if that brings any
> solution to this issue,
>
> best regards.
>
> Rodrigo
>
> On 3 dic, 10:00, Juan <[email protected]> wrote:
>
>
>
> > I don't think it is related to Oracle. We've been using distributed
> > transaction with NH and no issues. Part of your problem seems to be
> > that you are trying to start up an ADO.NET/NH transaction inside the
> > TransactionScope, this is not needed. Once in a transaction scope, NH
> > is smart enough to pick this up, and every sql statement will be
> > withing the distributed transaction. You will see some weird messages
> > in the log, about a transaction present set to null or something like
> > that, you can ignore those with an Oracle DB
>
> > On Dec 2, 5:18 pm, rodri_ogri <[email protected]> wrote:
>
> > > I forgot to paste the message :P,
>
> > > "[NHibernate.TransactionException]{"Begin failed with SQL exception"}
> > > The connection is already part of a local or distributed transaction"
>
> > > Is it a Oracle related issue?
>
> > > best regards
>
> > > On 2 dic, 12:31, Fabio Maulo <[email protected]> wrote:
>
> > > > A stack trace without the exception message is more than enough.
> > > > Thanks.
>
> > > > On Thu, Dec 2, 2010 at 12:54 PM, rodri_ogri <[email protected]> 
> > > > wrote:
> > > > > Hi all,
>
> > > > > I have tried something I thought was fixed on this version, it is the
> > > > > capability to work with TransactionScope and NH transactions with an
> > > > > Oracle 11G DB.
>
> > > > > This is the test I have done:
>
> > > > > [TestMethod]
> > > > >        public void TransactionScope_Test()
> > > > >        {
> > > > >            bool vTransactionInitialized = false;
>
> > > > >            using(TransactionScope vTx = new
> > > > > TransactionScope(TransactionScopeOption.Required))
> > > > >            {
> > > > >                using (ISession vSession =
> > > > > SessionFactory.OpenSession())
> > > > >                {
> > > > >                    using(ITransaction vNHTransaction =
> > > > > vSession.BeginTransaction())
> > > > >                    {
> > > > >                        try
> > > > >                            {
> > > > >                            vTransactionInitialized = true;
> > > > >                            vNHTransaction.Commit();
> > > > >                            }
> > > > >                            catch (Exception)
> > > > >                            {
> > > > >                            vNHTransaction.Rollback();
> > > > >                            }
> > > > >                    }
> > > > >                }
> > > > >                vTx.Complete();
> > > > >            }
>
> > > > >            Assert.IsTrue(vTransactionInitialized);
> > > > >        }
>
> > > > > It throws a NHibernate.TransactionException with the following trace:
>
> > > > > Oracle.DataAccess.Client.OracleConnection.BeginTransaction(IsolationLevel
> > > > > isolationLevel)
> > > > > Oracle.DataAccess.Client.OracleConnection.BeginDbTransaction(IsolationLevel
> > > > > isolationLevel)
>
> > > > > System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction(
> > > > >  )
> > > > > NHibernate.Transaction.AdoTransaction.Begin(IsolationLevel
> > > > > isolationLevel) in d:\CSharp\NH\nhibernate\src\NHibernate\Transaction
> > > > > \AdoTransaction.cs: line 130
> > > > > NHibernate.Transaction.AdoTransaction.Begin(IsolationLevel
> > > > > isolationLevel) in d:\CSharp\NH\nhibernate\src\NHibernate\Transaction
> > > > > \AdoTransaction.cs: line 145
> > > > > NHibernate.Transaction.AdoTransaction.Begin() in d:\CSharp\NH
> > > > > \nhibernate\src\NHibernate\Transaction\AdoTransaction.cs: line 94
> > > > > NHibernate.AdoNet.ConnectionManager.BeginTransaction() in d:\CSharp\NH
> > > > > \nhibernate\src\NHibernate\AdoNet\ConnectionManager.cs: line 324
> > > > > NHibernate.Impl.SessionImpl.BeginTransaction() in d:\CSharp\NH
> > > > > \nhibernate\src\NHibernate\Impl\SessionImpl.cs: line 1437
>
> > > > > Is it possible to have it fixed on this new version?
>
> > > > > best regards
>
> > > > > Rodrigo
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups
> > > > > "nhusers" group.
> > > > > To post to this group, send email to [email protected].
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<nhusers%[email protected]
> > > > >  >
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/nhusers?hl=en.
>
> > > > --
> > > > Fabio Maulo

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to