This usually occurs when you're debugging something in IIS. The fix that worked for me was the following:
In Visual Studio, go to Tools => Options => Debugging => General => Uncheck "Suppress JIT optimization on module load" On Jul 16, 5:51 am, "Frans Bouma" <[email protected]> wrote: > > Thanks Frans & [email protected] for your quick responses and clarifications. > > > I am using Microsoft Windows XP Professional 32 bit SP33 OS. > > > I have installed - Oracle 11g Client (11.1.0.6) and ODAC for Oracle Client > > (11.1.0.6.21), ODP.NET (Version -ODAC for Oracle Client > > (11.1.0.6.21)) - But, i am not sure of whether this is 32 bit ODP.NET or > 64 > > bit ODP.NET. > > You don't have to install a client if you install ODP.NET. So for > testing, uninstall both ODAC and the oracle 11g client and download the > 32bit ODP.NET 11g provider and only install that one. When you install two > clients (which you actually did) it might be you get two oracle homes > defined and you might use the 11g client with the odp.net assembly causing > mismatches. > > We've seen the same error in Sybase ADO.NET providers for ASE, which > use the same setup as ODP.NET, caused by the same kind of setup error. > > FB > > ------------------------------------------------------------------------ > Lead developer of LLBLGen Pro, the productive O/R mapper for .NET > LLBLGen Pro website:http://www.llblgen.com > My .NET blog:http://weblogs.asp.net/fbouma > Twitter:http://twitter.com/FransBouma > Microsoft MVP (C#). > ------------------------------------------------------------------------ > > > > > _____ > > If there is a way to dentify whether ODP.NET is 32bit compatible or 64bit > > compatible please let me know. Meanwhile i will try to figure out the > same. > > _____ > > > Also please note that I face this exception intermittently. > > _____ > > > On Jul 16, 2:18 pm, [email protected] wrote: > > > I had exactly the same issue with x64 OS and ODP.Net. (In my case it > > > was XP 64) Occurence : running debug in x64 using VS 2008. > > > I think Frans is right. > > > > Selon Frans Bouma <[email protected]>: > > > > > > I am posting here an issue that i observed with NHibernate. Sorry > > > > > to post here if this is already (if so please redirect me to the > > same). > > > > > > Details of my project: > > > > > NHibernate version used - 1.2 > > > > > Underlying database - Oracle 11g. > > > > > .NET language - C#, .NET Framework - 3.5 > > > > > > Issue: > > > > > > Code: > > > > > Attempted to read or write protected memory. This is often an > > > > > indication that other memory is corrupt. > > > > > Likely a problem with ODP.NET. I'm not sure which version of > > > > ODP.NET you're using, but be sure you're using a recent build and > > > > also that you install the proper version for your OS, so the 64bit > > > > version for your 64bit OS or the 32bit version for the 32bit OS. > > > > > ODP.NET is a .NET wrapper around a Java based client, and the > > > > exception occurs inside the client, not the code calling it. > > > > > FB > > > > > > The inner exception is: > > > > > An exception of type 'NHibernate.ADOException' occurred in method > > 'DoList' > > > > > of class 'Loader' > > > > > > The stack trace given is: > > > > > at NHibernate.Loader.Loader.DoList(ISessionImplementor session, > > > > > QueryParameters queryParameters) in C:\Documents and Settings\test > > > > > \Desktop\NHibernate-1.2.1.GA-src\src\NHibernate\Loader\Loader.cs:l > > > > > ine > > > > > 1803 > > > > > at > > > > > NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor > > > > > session, QueryParameters queryParameters) in C:\Documents and > > > > > Settings > > > > > \test\Desktop\NHibernate-1.2.1.GA-src\src\NHibernate\Loader > > > > > \Loader.cs:line 1745 > > > > > at NHibernate.Loader.Loader.List(ISessionImplementor session, > > > > > QueryParameters queryParameters, ISet querySpaces, IType[] > > > > > resultTypes) in C:\Documents and Settings\test\Desktop > > > > \NHibernate-1.2.1.GA- > > > > > src\src\NHibernate\Loader\Loader.cs:line 1733 > > > > > at NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria, > > > > > IList > > > > > results) in C:\Documents and > > > > > Settings\test\Desktop\NHibernate-1.2.1.GA- > > > > > src\src\NHibernate\Impl\SessionImpl.cs:line 4963 > > > > > at NHibernate.Impl.SessionImpl.Find[T](CriteriaImpl criteria) in > C: > > > > > \Documents and Settings\test\Desktop\NHibernate-1.2.1.GA-src\src > > > > > \NHibernate\Impl\SessionImpl.cs:line 4914 > > > > > at NHibernate.Impl.CriteriaImpl.List[T]() in C:\Documents and > > > > > Settings\test\Desktop\NHibernate-1.2.1.GA-src\src\NHibernate\Impl > > > > > \CriteriaImpl.cs:line 323 > > > > > > The inner exception is: > > > > > An exception of type 'System.AccessViolationException' occurred in > > > > > method 'Read' of class 'OpsDac' > > > > > > The stack trace given is: > > > > > at Oracle.DataAccess.Client.OpsDac.Read(IntPtr opsConCtx, > > > > > IntPtr opsErrCtx, IntPtr opsSqlCtx, IntPtr& opsDacCtx, > > > > > OpoSqlValCtx* > > > > pOpoSqlValCtx, > > > > > OpoMetValCtx* pOpoMetValCtx, OpoDacValCtx* > > > > > pOpoDacValCtx) > > > > > at Oracle.DataAccess.Client.OracleDataReader.Read() > > > > > at NHibernate.Loader.Loader.DoQuery(ISessionImplementor > > > > > session, QueryParameters queryParameters, Boolean returnProxies) in > C: > > > > > \Documents and Settings\test\Desktop\NHibernate-1.2.1.GA-src\src > > > > > \NHibernate\Loader\Loader.cs:line 440 > > > > > at > > > > > NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISes > > > > sionImpl > > > > > ementor > > > > > session, QueryParameters queryParameters, Boolean returnProxies) in > C: > > > > > \Documents and Settings\test\Desktop\NHibernate-1.2.1.GA-src\src > > > > > \NHibernate\Loader\Loader.cs:line 181 > > > > > at NHibernate.Loader.Loader.DoList(ISessionImplementor session, > > > > > QueryParameters queryParameters) in C:\Documents and Settings\test > > > > > \Desktop\NHibernate-1.2.1.GA-src\src\NHibernate\Loader\Loader.cs:l > > > > > ine > > > > > 1793 > > > > > > Code Accessing NHibernate: > > > > > I save an object say 'OBJ1' in database using ADO.NET, and then i > > > > > try to load it from NHibernate, but at this time i get the above > > > > > reported exception. > > > > > > Below is the sample code. > > > > > > Code: > > > > > public void Main() > > > > > { > > > > > //Placeholder for saving ID of new record that is saved through > > ADO. > > > > > decimal static ADOSavedObjectID; > > > > > > ADONewTestRecord obj = new ADONewTestRecord(); > > > > > > //ADO.NET code to save this returns saved object db ID. > > > > > ADOSavedObjectID = SaveThroughADO(obj); > > > > > > //Fetch the Saved record through NHibernate. > > > > > TestNewRecordFromNHibernate = > > > > > GetTestRecordThroughNHibernate(ADOSavedObjectID) > > > > > > public decimal SaveThroughADO(ADONewTestRecord obj) > > > > > { > > > > > //ADO code. > > > > > } > > > > > > public TestNewRecordFromNHibernate > > > > > GetTestRecordThroughNHibernate(decimal ADOSavedObjectID) > > > > > { > > > > > return LoadNHibernateObject(ADOSavedObjectID); > > > > > } > > > > > > public TestNewRecordFromNHibernate > > > > > LoadNHibernateObject(decimal > > > > > ADOSavedObjectID) > > > > > { > > > > > //NHibernate session is already opened, i am not providing > > > > details. > > > > > Session.Clear(); > > > > > IList<TestNewRecordFromNHibernate> results; > > > > > ICriteria criteria = Session.CreateCriteria(typeof > > > > > (TestNewRecordFromNHibernate)); > > > > > criteria.Add(Expression.Eq("ID", > > > > > ADOSavedObjectID)); > > > > > //In this line i get the reported exception see above. > > > > > results = criteria.List<TestNewRecordFromNHibernate>(); > > > > > return results[0]; > > > > > } > > > > > } > > > > > > -- > > > > > 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. > > > > > -- > > > > 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.-Hide quoted text - > > > > - Show quoted text - > > > -- > > 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. -- 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.
