Hi,

I tried your proposal (should have had the same idea :( and got the
same error message.

After I switched to the ODAC driver for 10g the message disappeared,
but didn't get it to work with TransactionScop either. But it seems
that using TransactionScope requires some stuff I cannot guarantee in
my application setup and thus I won't use it. It's a pity because I
liked this approach.

Thanks,
Marc

On 31 Mrz., 14:46, Ayende Rahien <[email protected]> wrote:
> Try executing an ORA command without NH, see what happens.
>
> On Tue, Mar 31, 2009 at 4:32 AM, eilensm <[email protected]> wrote:
>
> > Hello,
>
> > I'm trying to get TransactionScope to work with an Oracle 11g in a
> > simple prototyping application.
>
> > I'm using NHibernate 2.0.1GA and .NET 3.5, ODAC 11.1.0.6.20.
>
> > I created a simple table TXTEST and the following mapping for it:
>
> > <class name="TxTest" table="TXTEST">
> >    <id name="Id" column="ID" type="System.Int32">
> >      <generator class="sequence">
> >        <param name="sequence">TXTEST_SEQ</param>
> >      </generator>
> >    </id>
> >    <property name="Name" column="NAME" type="String"/>
> >  </class>
> > <<<
>
> > When running my test code with a using block for creating the
> > TransactionScope instance, I get an error I don't understand. Without
> > this using block, everything works just fine.
> > A guess is, that there might be a problem with the TransactionScope
> > and the ID sequence. But I'm not sure.
>
> > Here is the code snippet followed by the error message I got.
>
> > Any help is very appreciated!
>
> > Thanks in advance,
> > Marc
>
> > private void TestHibernate()
> > {
> >        ISessionFactory sessionFactory = new Configuration().Configure
> > ().BuildSessionFactory();
> >        //using (TransactionScope txScope = new TransactionScope
> > (TransactionScopeOption.Required))
> >        //{
> >                using (ISession session = sessionFactory.OpenSession())
> >                {
> >                        TxTest obj = new TxTest();
> >                        obj.Name = "Eilens";
> >                        session.Save(obj);
> >                        session.Flush();
> >                        LogManager.GetLogger(this.GetType()).Debug("obj: " +
> > obj.Id + ",
> > name: " + obj.Name);
> >                }
> >        //}
> > }
> > <<<
>
> > NHibernate.ADOException was unhandled
> >  Message="cannot open connection"
> >  Source="NHibernate"
> >  StackTrace:
> >       at NHibernate.Impl.SessionFactoryImpl.OpenConnection()
> >       at NHibernate.AdoNet.ConnectionManager.GetConnection()
> >       at NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd)
> >       at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand
> > cmd)
> >       at NHibernate.Id.SequenceGenerator.Generate(ISessionImplementor
> > session, Object obj)
> >       at
> > NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId
> > (Object entity, String entityName, Object anything, IEventSource
> > source, Boolean requiresImmediateIdAccess)
> >       at
>
> > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId
> > (SaveOrUpdateEvent event)
> >       at
>
> > NHibernate.Event.Default.DefaultSaveEventListener.SaveWithGeneratedOrRequestedId
> > (SaveOrUpdateEvent event)
> >       at
> > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient
> > (SaveOrUpdateEvent event)
> >       at
> > NHibernate.Event.Default.DefaultSaveEventListener.PerformSaveOrUpdate
> > (SaveOrUpdateEvent event)
> >       at
> > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate
> > (SaveOrUpdateEvent event)
> >       at NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent
> > event)
> >       at NHibernate.Impl.SessionImpl.Save(Object obj)
> >       at TxPrototyp.Form1.TestHibernate()
> >       at TxPrototyp.Form1..ctor()
> >       at TxPrototyp.Program.Main()
> >       at System.AppDomain._nExecuteAssembly(Assembly assembly, String
> > [] args)
> >       at System.AppDomain.ExecuteAssembly(String assemblyFile,
> > Evidence assemblySecurity, String[] args)
> >       at
> > Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> >       at System.Threading.ThreadHelper.ThreadStart_Context(Object
> > state)
> >       at System.Threading.ExecutionContext.Run(ExecutionContext
> > executionContext, ContextCallback callback, Object state)
> >       at System.Threading.ThreadHelper.ThreadStart()
> >  InnerException: Oracle.DataAccess.Client.OracleException
> >       Message="Interner Daten-Provider-Fehler(-3000) [System.String]"
> >       Source="Oracle Data Provider for .NET"
> >       ErrorCode=-2147467259
> >       DataSource=""
> >       Number=-3000
> >       Procedure=""
> >       StackTrace:
> >            at
> > Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
> > errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
> > pOpoSqlValCtx, Object src, String procedure)
> >            at Oracle.DataAccess.Client.OracleException.HandleError
> > (Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
> >            at Oracle.DataAccess.Client.OracleConnection.Open()
> >            at
> > NHibernate.Connection.DriverConnectionProvider.GetConnection()
> >            at NHibernate.Impl.SessionFactoryImpl.OpenConnection()
> >       InnerException:
>
> > <<<
--~--~---------~--~----~------------~-------~--~----~
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