On Dec 28, 12:24 pm, daniel_spaniel <[email protected]> wrote:
> Hi
>  I had an error that looked like this:
>
> Sequel::DatabaseError (ODBC::Error: 08S01 (9305) [unixODBC][Pervasive]
> [ODBC Client Interface][Client LNA]Your connection to the server is no
> longer working. To continue, disconnect from the data source and re-
> connect again. Contact your system administrator if you still need
> assistance.):
>
> stacktrace:
>
>  sequel (3.5.0) lib/sequel/adapters/odbc.rb:51:in `run'
>   sequel (3.5.0) lib/sequel/adapters/odbc.rb:51:in `execute'
>   sequel (3.5.0) lib/sequel/connection_pool.rb:112:in `hold'
>   sequel (3.5.0) lib/sequel/database.rb:482:in `synchronize'
>   sequel (3.5.0) lib/sequel/adapters/odbc.rb:49:in `execute'
>   sequel (3.5.0) lib/sequel/dataset.rb:334:in `execute'
>   etc...
>
> And I was wondering what the most efficient way to handle this kind of
> exception would be. I would like to drop the connection, get a new
> connection and try again when this happens. But not sure how to do
> that.

The Sequel way to handle it is to have the ODBC adapter recognize the
error and raise a Sequel::DatabaseDisconnectError instead.
Unfortunately, I'm not sure if the error you received is a general
ODBC error that applies to all databases, or one specific to
Pervasive.  If the former, you could patch the ODBC adapter, similar
to how it is handled in the MySQL, PostgreSQL, and Oracle adapters.
If the latter, you'll have to add a Pervasive ODBC subadapter and
override methods where necessary (Sequel::ODBC::Database #run and/or
#execute).

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