Rob Kraft's Software Development Blog

Software Development Insights

Archive for March, 2014

Error ORA-1153 using Oracle.ManagedDataAccess.DLL to connect

Posted by robkraft on March 17, 2014

We switched from using Oracle.DataAccess.DLL to Oracle.ManagedDataAccess.DLL in our .Net App.  The code change took minutes, but all the connection string  changes took me a few hours to resolve.  The last error I kept receiving when I tried to connect to Oracle was ORA-1153.  Specifically I had the following values in the exception:

  • HResult: -2147467259
  • Message: Oracle error ORA-1153 encountered
  • Source : Oracle Data Provider for .NET, Managed Driver

This error occurred when the code tried to open the connection

  • _cnOra.Open();

The error occurred because I was missing the CONNECT_DATA value from the descriptor in my datasource of my application .config file.  I had this value:

<dataSource alias=”dev” descriptor=”(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myServerName)(PORT=1521)) )”/>

when I should have had this value:

<dataSource alias=”dev” descriptor=”(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myServerName)(PORT=1521)) (CONNECT_DATA = (SERVICE_NAME = dev)))”/>

 

Advertisements

Posted in Coding | 2 Comments »