473,750 Members | 2,186 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Attempted to read or write protected memory using TransactionScop e and Oracle 10g Client.

We are randomly getting this error message on our development and
staging machines:

Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.; at
System.Data.Com mon.UnsafeNativ eMethods.OraMTS JoinTxn(OciEnli stContext
pCtxt, IDtcTransaction pTrans)
at
System.Data.Ora cleClient.Trace dNativeMethods. OraMTSJoinTxn(O ciEnlistContext
pCtxt, IDtcTransaction pTrans)
at System.Data.Ora cleClient.Oracl eInternalConnec tion.Enlist(Str ing
userName, String password, String serverName, Transaction transaction,
Boolean manualEnlistmen t)
at
System.Data.Ora cleClient.Oracl eInternalConnec tion.Activate(T ransaction
transaction)
at
System.Data.Pro viderBase.DbCon nectionInternal .ActivateConnec tion(Transactio n
transaction)
at
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n)
at
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry)
at System.Data.Ora cleClient.Oracl eConnection.Ope n()

We are using VS2005, C#, Oracle 10g Client, and the TransactionScop e.
When we get this error, it's usually either on the opening of the
connection OR on the execution of the proc/package. We had to install
the client, then install, as a separate package the oracle support for
MTS which supports transactions.

Here is a snippet of code that causes this error:

using (TransactionSco pe scope = new TransactionScop e())
{
using (IDbConnection connection = this.GetConnect ion())
{
connection.Open ();
...DO SOME STUFF
try
{
command.Execute NonQuery();
foreach (IDataParameter parameter in command.Paramet ers)
{
if( parameter.Direc tion.Equals(
ParameterDirect ion.InputOutput ) || parameter.Direc tion.Equals(
ParameterDirect ion.Output ) )
returnParameter s.Add(parameter );
}
}
catch (Exception ex)
{
// ERROR HANDLING HERE
}
}
scope.Complete( );
}

Like I said, it happens randomly, but when it does occur, it's on one
of those two methods Open or Execute. Does anyone have any idea why
this breaks down

Thanks in advance for your help!

Sean

Feb 21 '06 #1
3 7120
bob
Hi,
They don't come much worse than this do they?
As a test I suggest that you instantiate a new connection inside the method
rather than calling out for it.

FWIW
Bob
<OU*********@gm ail.com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.com...
We are randomly getting this error message on our development and
staging machines:

Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.; at
System.Data.Com mon.UnsafeNativ eMethods.OraMTS JoinTxn(OciEnli stContext
pCtxt, IDtcTransaction pTrans)
at
System.Data.Ora cleClient.Trace dNativeMethods. OraMTSJoinTxn(O ciEnlistContext pCtxt, IDtcTransaction pTrans)
at System.Data.Ora cleClient.Oracl eInternalConnec tion.Enlist(Str ing
userName, String password, String serverName, Transaction transaction,
Boolean manualEnlistmen t)
at
System.Data.Ora cleClient.Oracl eInternalConnec tion.Activate(T ransaction
transaction)
at
System.Data.Pro viderBase.DbCon nectionInternal .ActivateConnec tion(Transactio n transaction)
at
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n)
at
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry)
at System.Data.Ora cleClient.Oracl eConnection.Ope n()

We are using VS2005, C#, Oracle 10g Client, and the TransactionScop e.
When we get this error, it's usually either on the opening of the
connection OR on the execution of the proc/package. We had to install
the client, then install, as a separate package the oracle support for
MTS which supports transactions.

Here is a snippet of code that causes this error:

using (TransactionSco pe scope = new TransactionScop e())
{
using (IDbConnection connection = this.GetConnect ion())
{
connection.Open ();
...DO SOME STUFF
try
{
command.Execute NonQuery();
foreach (IDataParameter parameter in command.Paramet ers)
{
if( parameter.Direc tion.Equals(
ParameterDirect ion.InputOutput ) || parameter.Direc tion.Equals(
ParameterDirect ion.Output ) )
returnParameter s.Add(parameter );
}
}
catch (Exception ex)
{
// ERROR HANDLING HERE
}
}
scope.Complete( );
}

Like I said, it happens randomly, but when it does occur, it's on one
of those two methods Open or Execute. Does anyone have any idea why
this breaks down

Thanks in advance for your help!

Sean

Feb 21 '06 #2
dom
1 New Member
Have a look to the service called 'Distributed Transaction Coordinator'. It must be set to Automatic Start. Otherwise the error occurs.
May 2 '06 #3
naz
1 New Member
That worked and was very helpful, thanks. . .

Have a look to the service called 'Distributed Transaction Coordinator'. It must be set to Automatic Start. Otherwise the error occurs.
Jul 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
21352
by: hiralparikh | last post by:
Hi, I am using .NET 2.0 and trying to use a function from a native DLL file. Here is the syntax that I am using: definition: public static extern String getPwd(String strServerName, String strUserId);
1
1975
by: OUSoonerTaz | last post by:
We are randomly getting this error message on our development and staging machines: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.; at System.Data.Common.UnsafeNativeMethods.OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans) at System.Data.OracleClient.TracedNativeMethods.OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans)
4
7288
by: Seok Bee | last post by:
Dear Experts, I have created a script to extract the Event Logs from the system into an excel sheet. The logs are separated into 2 worksheets (Application Log and System Log). After this excel file being created, it will be sent out via email to the list of recipients. I run the script on my notebook (also developed on th same machine) it works fine. However, when I copy all the programs into the server which running on Windows 2000...
2
21977
by: Ilkka | last post by:
I have created an C++ application with Windows Forms, ADO and SQL server 2005. Now I need to change something and started debugging the code. Then suddenly I receive an error. "An unhandled exception of type 'System.AccessViolationException' occurred in mscorlib.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." The progran ends on a windows form designer...
2
4186
by: Pieter | last post by:
Hi, Since 10 days (the first time was the 10th of november) I have some weird exception happening in an application here: All (except 1 of the total of 5) users had this error now 1 of 2 times during the last 10 days. It happens mostly during startup or closing of the application, but sometimes just in the middle of nowhere. It doesn't point to anyting special. I don't get a clue... It's a Windows Forms VB.NET 2005 application. I roll...
5
13664
by: deepakkumarb | last post by:
I am getting this exception while executing non query from .NET code to oracle 10g DB. Can you plz help System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Reflection.AssemblyName.nInit(Assembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent) at System.Reflection.AssemblyName.nInit() at...
2
20740
by: adypoly | last post by:
Hi guys... I am having a typical problem in using one of the native dll in C# I'll explain what am trying to do, I've a dll written in C language which i am trying to include in my C# project, the solutions builds fine but once i try to run the program it gives an exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt" I am passing two integer pointer variables as the...
1
2544
by: =?Utf-8?B?UGFydGhpYmFu?= | last post by:
We are doing a dataAdapter.fill(dataset) while reading data from oracle databse. We are getting the following error randomly. " Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Note that we have migrated from .NET 1.1 to .NET 2.0 very recently and we have been getting this error only after migration. Can anyone please help us? --
3
6947
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or write protected memory. this is often an indication that other memory is corrupt.... " These are all the platform info : Visual Studio 2005 (VB.NET) and ASP.NET 2.0.
0
8999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9394
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.