On May 4, 9:26 am, cult hero <[email protected]> wrote:
> I have a web app that connects to an MSSQL DB (2005 I believe). The
> provider of this database is, for lack of a better work, kind of
> flaky. Every couple days the connection will just crap out and
> anything that tries to use the models from this database will barf up
> the following error:
>
> Exception raised: Sequel::DatabaseError
> Message: ODBC::Error: 08S01 (0) [unixODBC][FreeTDS][SQL
> Server]Communication link failure
>
> Aside from simply redefining the constant DB_MSSQL (presuming that
> would work) is there some kind of method to reconnect?
>
> Right now I restart the application, but I'd prefer to have the
> application fix itself when that error is raised.

The Sequel ODBC adapter does not use DatabaseDisconnectError to signal
that the connection was disconnected.  If added, it would signal the
connection pool to drop the connection, so the next request would get
a new connection.  So I would look into adding support for that to the
ODBC adapter.  Hopefully that 08S01 error always indicates
disconnection, in which case it should be possible to handle with a
regular expression.  See the MySQL adapter for an example of how to
handle it.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to