During our integration tests, we noted a problem about the connection.
Suppose I invoke the web service that takes an id and returns a string value read from the db.
Then the Oracle DB has been shutdown and restarted.
If I invoke the web service again, I got an error that I cannot avoid even if I try again and again. Stopping the web site on IIS6 didn't change anything. I had to reboot the web server machine.
I translate en english, because the error is written in french. It is more or less (may not be the orginal english msg) :
Database error ---> Impossible to write the data on the transport connection. --> An existing connexion has been closed by a remote host.
Code: Select all
System.Web.Services.Protocols.SoapException: Erreur de la base de données ---> System.IO.IOException: Impossible d'écrire les données sur la connexion de transport. ---> System.Net.Sockets.SocketException: Une connexion existante a dû être fermée par l'hôte distant
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
--- --- ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at a.a.ai.a(Byte[] A_0, Int32 A_1)
at a.a.be.d()
at a.a.al.a()
at a.a.al.b(Byte[] A_0, Int32 A_1, Int32 A_2)
at a.a.al.b()
at a.a.ad.a()
at a.a.bf.a(Int32 A_0, ay A_1)
at CoreLab.Oracle.OracleCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
at CoreLab.Common.DbCommandBase.b(CommandBehavior A_0)
at CoreLab.Common.DbCommand.ExecuteReader()
at CoreLab.Common.DbCommandBase.ExecuteNonQuery()
at WSPolyrightEPFL.TWSPolyrightEPFL.GetSciper(String cardid)
--- --- ---
at WSPolyrightEPFL.TWSPolyrightEPFL.GetSciper(String cardid)
When I closed the first connection I used, it has then been released to the connection pool.
Then the Oracle server has restarted and the connection in the connection pool was not valid anymore.
As the documentation said the TAF (failover) is not available when working in direct mode (that's my case), so the connection has not been recreated automatically. In could explain why I always get the same error, even if Oracle was up.
So when I instanciate a new connection (retrieve it from the pool), how could I test if it is valid or not?
I read in the MySQLDirect FAQ that a MySqlConnection.Ping() method exist to check if the connection is alive or not. There is no similar method for OraDirect, so have you any other solution (always working in direct mode)?
Many thanks.
Adriano