J
jdw
I am using asp.net (Framework 1.1) with Oracle 9i and ODP.Net version
9.2.0.401. I am developing using a local copy of IIS version 5.1. When
I use a connection string to connect to Oracle utilising a data source
in my TNSNames.ora file initially everything is fine and I can connect
without any problem.
After about 2 minutes as I move from page to page and requery the
database I seem to loose the connection with the error "ORA-12154:
TNS:could not resolve service name".
I am using the following line in my web.config file to create the
connection string:-
<add key="Main.ConnectionString" value="data source=dev.ora;User
Id=xxxx;Password=xxxx;persist security
info=false;Pooling=true;Connection Lifetime=120;Min Pool Size=0;Incr
Pool Size=1;Decr Pool Size=1;Max Pool Size=20;"/>
Interestingly if I change this to the relevant data source entry within
my TNSNames file:-
<add key="Main.ConnectionString" value="data
source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxx)(PORT=xxxx)))(CONNECT_DATA
=(SERVICE_NAME = dev.xxx.xxx.xx)) );User
Id=xxxx;Password=xxxx;Pooling=true;Connection Lifetime=120;Min Pool
Size=0;Incr Pool Size=1;Decr Pool Size=1;Max Pool Size=20;"/>
Then I do not have any problems. I would prefer to use TNSNames rather
than entering the datasource directly. Has anyone any ideas why I loose
the connection?
9.2.0.401. I am developing using a local copy of IIS version 5.1. When
I use a connection string to connect to Oracle utilising a data source
in my TNSNames.ora file initially everything is fine and I can connect
without any problem.
After about 2 minutes as I move from page to page and requery the
database I seem to loose the connection with the error "ORA-12154:
TNS:could not resolve service name".
I am using the following line in my web.config file to create the
connection string:-
<add key="Main.ConnectionString" value="data source=dev.ora;User
Id=xxxx;Password=xxxx;persist security
info=false;Pooling=true;Connection Lifetime=120;Min Pool Size=0;Incr
Pool Size=1;Decr Pool Size=1;Max Pool Size=20;"/>
Interestingly if I change this to the relevant data source entry within
my TNSNames file:-
<add key="Main.ConnectionString" value="data
source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxx)(PORT=xxxx)))(CONNECT_DATA
=(SERVICE_NAME = dev.xxx.xxx.xx)) );User
Id=xxxx;Password=xxxx;Pooling=true;Connection Lifetime=120;Min Pool
Size=0;Incr Pool Size=1;Decr Pool Size=1;Max Pool Size=20;"/>
Then I do not have any problems. I would prefer to use TNSNames rather
than entering the datasource directly. Has anyone any ideas why I loose
the connection?