Hi Rodrigo,

I'm not an Oracle guy. I don't know the differences between flavors of
Oracle driver. I don't see anything obviously wrong. I wish I could be more
help.

Thanks,
Jason

On Tue, Dec 7, 2010 at 11:12 AM, rodri_ogri <[email protected]> wrote:

> Hi Jason,
>
> I've tried with the Oracle.DataAccess v4.112.1.2 assembly and it
> doesn't work either. (I have tried with the v2.11.2.1.0 before)
>
> I'm also configuring a Distributed transaction factory to my
> configuration as follows:
> vObjConfiguracion.SetProperty("transaction.factory_class",
> "NHibernate.Transaction.AdoNetWithDistributedTransactionFactory,
> NHibernate");
>
> I have used Reflector to get into the
> Oracle.DataAccess.OracleClient.OracleConnection class and I saw that
> the exception is thrown when it tries to validate if the transaction
> exists:
>
> public unsafe OracleTransaction BeginTransaction()
> {
>    if (this.m_contextConnection)
>    {
>        throw new NotSupportedException();
>    }
>    if (OraTrace.m_TraceLevel != 0)
>    {
>        OraTrace.Trace(1, new string[] { " (ENTRY)
> OracleConnection::BeginTransaction()\n" });
>    }
>    this.m_oraTransaction = this.GetTransaction();
>    // IT TRIES TO ENTER HERE
>    if ((this.m_oraTransaction != null) ||
> (this.m_opoConCtx.pOpoConValCtx.InMtsTxn == 1))
>    {
>       // AND INDEED, IT GETS IN HERE!
>        throw new
>
> InvalidOperationException(OpoErrResManager.GetErrorMesg(ErrRes.CON_ALREADY_TXNED,
> new string[0]));
>    }
>    this.m_oraTransaction = new OracleTransaction(this,
> IsolationLevel.ReadCommitted, this.TxnHndAllocated);
>    if (OraTrace.m_TraceLevel != 0)
>    {
>        OraTrace.Trace(1, new string[] { " (EXIT)
> OracleConnection::BeginTransaction()\n" });
>    }
>    return this.m_oraTransaction;
> }
>
> Any clues?
>
> best regards
> Rodrigo
>
> PD. I have my configuration as follows:
>
> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
>  <session-factory>
>    <property
> name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
> property>
>    <property name="dialect">NHibernate.Dialect.Oracle10gDialect</
> property>
>    <property
> name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</
> property>
>    <property
> name="connection.connection_string_name">ConnectionString.Oracle
> (ODP.NET)</property>
>    <property
>
> name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory,
> NHibernate.ByteCode.LinFu</property>
>    <property name="show_sql">false</property>
>    <property name="query.substitutions">true=1;false=0</property>
>    <mapping  assembly="MyEnterprise.Model" />
>  </session-factory>
> </hibernate-configuration>
>
> On 4 dic, 16:56, Jason Dentler <[email protected]> wrote:
> > The code looks correct. Can you post your configuration?
> >
> > On Fri, Dec 3, 2010 at 3:59 PM, rodri_ogri <[email protected]> wrote:
> > > Hi Fabio,
> > > I followed your comment and I tried with both factories, but none of
> > > them works, unless I'm not assigning the correct way the factory
> > > (myConfiguration.SetProperty("transaction.factory_class",
> > > "NHibernate.Transaction.AdoNetWithDistributedTransactionFactory,
> > > NHibernate");) .
> >
> > > regards
> >
> > > On 3 dic, 12:13, Fabio Maulo <[email protected]> wrote:
> > > > Yes but it may depend on the transaction-factory he has configured.
> > > > NH has 2 transaction factories:
> > > > AdoNetWithDistributedTransactionFactory (default)
> > > > AdoNetTransactionFactory (was default in previous versions)
> >
> > > > On Fri, Dec 3, 2010 at 11:00 AM, 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]>
> <nhusers%[email protected]<nhusers%[email protected]>
> >
> > > <nhusers%[email protected]<nhusers%[email protected]>
> <nhusers%[email protected]<nhusers%[email protected]>
> >
> >
> > > > > <nhusers%[email protected]<nhusers%[email protected]>
> <nhusers%[email protected]<nhusers%[email protected]>
> >
> > > <nhusers%[email protected]<nhusers%[email protected]>
> <nhusers%[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]<nhusers%[email protected]>
> <nhusers%[email protected]<nhusers%[email protected]>
> >
> > > <nhusers%[email protected]<nhusers%[email protected]>
> <nhusers%[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]<nhusers%[email protected]>
> <nhusers%[email protected]<nhusers%[email protected]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/nhusers?hl=en.
>

-- 
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