Question

Very.. stupid problem.

A call to SQLAnywhere12 is done from c# code.

  • A database call to an available database is made and answered correctly.
  • If the database is shut down (e.g. network) after it has initially worked, new connections just hang.

The last things I can see on the callstack are:

  • Intellitrace.OpenConnection
  • SAConnection.Open
  • SAConnectionPoolManager.AllocateConnection
  • ->Monitor.Enter

Monitor.Enter just seems to wait forever.

No Exception seems to be fired.

So my idea was to look at the connection state and only trigger the command if connection is open (and even there with a very bad feeling about it - a connection can be broken directly after asking for the state)

If i look at the connection object of the databae ( iAnywhere.Data.SQLAnywhere ) there is an available ConnectionState. This ConnectionState shows: "Open".

If no connection to database is available, I would expect either "Broken" or "Closed".

How can i tell SQLAnywhere to update the connection state?

Or is there even a better possibility to get an excpetion?

Was it helpful?

Solution

The problem was "solved".

Telerik OpenAccess is used as ORM. It has an own connectionpool.

Disabling the Telerik Connection Pool and Enabling ADo.Net Connection pool helped.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top