Link to home
Start Free TrialLog in
Avatar of FishmanTobin
FishmanTobin

asked on

System.UnauthorizedAccessException: Access to the path is denied IBM DB2

I have several programs which are not ASP.net but VB.net and I am getting this error:
 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'IBM.Data.DB2.iSeries.iDB2Trace' threw an exception. ---> System.UnauthorizedAccessException: Access to the path is denied.
 
 sporatically from some and consistently from others.
 
This all began after we upgraded to S6R1 and began using version 12 of the IBM.net connector.
 
The command this is occuring on is:
 
Public Connection As New iDB2Connection
 
Here is the full stack trace after the above command is executed:
 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'IBM.Data.DB2.iSeries.iDB2Trace' threw an exception. ---> System.UnauthorizedAccessException: Access to the path is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.EventWaitHandle..ctor(Boolean initialState, EventResetMode mode, String name)
   at IBM.Data.DB2.iSeries.iDB2NamedEvent..ctor(String eventName)
   at IBM.Data.DB2.iSeries.iDB2Trace..cctor()
   --- End of inner exception stack trace ---
   at IBM.Data.DB2.iSeries.iDB2Connection..ctor()

 
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

From the error message and stack trace, it looks like your process does not have rights to a file or folder that is being used as a trace log file.

IBM has a likely PTF for this issue:

http://www-01.ibm.com/support/docview.wss?uid=nas23fe81c193be8ca8d8625756f004215b7

- Gary Patterson


Avatar of FishmanTobin
FishmanTobin

ASKER

Gary it says this PTF solves this problem.  What PTF?  Where should I look for log file folders for trace?
PTF number is listed at the top of the article: SE37122.  Also in the title bar of your browser most likely when viewing the page.

ADO.NET provider trace log file by default is iDB2Log.txt

Tracing is controlled kicked off using the cwbmptrc program supplied with Client Access.  If I understand correctly, this program just changes some registry entries that the AS/400 .NET provider looks at to decide if it needs to produce trace output.  This means that if you use the program to turn on tracing, it stays on until you disable it.

You can also specify tracing in your connection string using the "Trace" parameter.

Here is a nice article on tracing:  http://systeminetwork.com/node/26086

- Gary Patterson
Not quite.  I made sure tracing was off and I gave the everyone group full control of my entire C drive.  Same error persists.
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
We can't find the PTF online anywhere.
We contacted IBM showed them the article you found and they gave us a link to the patch.  That worked points awarded.  Thanks.
Thanks for your help with this.
Glad to help.  For future reference, you can obtain PTF's online via Fix Central at

http://www.ibm.com/support/fixcentral/

- Gary Patterson