views:

408

answers:

2

I'm using ASP.NET 2.0 to connect to a Sybase Sql Anywhere 5 server. And I get this error sporadically. It just happens sometimes. The error message is:

ERROR [HY000] [Sybase][ODBC Driver]General error: attempted two active database requests

Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000] [Sybase][ODBC Driver]General error: attempted two active database requests

Anyone has any experience with this problem?

A: 

The error message means that you attempted to run two queries at the same time using the same database connection.

Are you trying to use the same database connection for all requests? The requests are handled by several threads, so each request needs to have it's own database connection.

Guffa
Thanks for the answer. It's what I thougt too, but I don't remember seeing this problem when using sql server, so I wanted a second opinion. Thanks again!
Cristian Donoso
A: 

Sounds like you're reusing the same connection for multiple commands. Check that you properly dispose of the connections after each command/batch of commands and that all new commands get a new connection.

PHeiberg