I've got a console program that does the following using the enterprise library and oracle ODP.NET
- Open connection
- Search for some data
- Close connection
- Wait a small period of time
- Repeat
After somewhere between 30 minutes and 3 hours (typically it's about 2 hours) I get an oracle 03113 end of file communication.
I've traced it to it getting a connection (well, thinking it has a connection) then it fails on the execution of a statement (i.e. the first time it tries to use the connection).
Typically (i'm in development), step 2 returns no data and always uses the same sql SELECT.
I've fixed it by adding 'Pooling=false' to the DSN:
<add name="DEV64" connectionString="Data Source=dev3;User Id=XXX;Password=YYY;Pooling=false" providerName="System.Data.OracleClient"/>
Obviously this isn't ideal, but I've no idea why it's doing this?
I have no firewall between me and the database and I tried ORA-03113: end-of-file on communication channel after long inactivity in ASP.Net app which had one solution of:
Validate Connection = True
But that just crashes with the driver not knowing this.
The code to do this, btw, is something like:
Get my context:
dac = new DataAccessContext(EnterpriseLibraryContainer.Current.GetInstance<Database>(AppSettingsHandler.ConnectionStringName));
open the connection:
Context.DBConnection = new DataAccessConnection(Context.Database.CreateConnection());
Context.DBConnection.Connection.Open();
return Context.DBConnection.Connection;
read the data, typically where it falls over, presumably a stale connection of sorts:
DataSet ds = context.Database.ExecuteDataSet(CommandType.Text, query);