473,766 Members | 2,093 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
1 1976
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

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);
3
7123
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
21978
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
13665
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
20743
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
2545
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? --
6
4499
by: Scott Gravenhorst | last post by:
Windows XP SP3 My application is set to open a SaveFile dialog when an exit is requested. When I click the app's close button, the save dialog opens, but when I click to change the folder, the exception occurs pointing to FileSaveDialog1.ShowDialog(). The exception also indicates some problem with system.drawing.dll. The exception text is: "Attempted to read or write protected memory. This is often an
3
6948
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
9568
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
9404
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
10008
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...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
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
6651
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();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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

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.