On Mon, Aug 16, 2021 at 1:07 AM armin <[email protected]> wrote:

>
> Hey,
>
> I have a problem with a MSSQL-Database-Connection. After some idle, I get
> following error:
>
>     /usr/local/bundle/gems/puma-5.3.2/lib/puma/thread_pool.rb:145:in
> `block in spawn_thread'Sequel::DatabaseDisconnectError: TinyTds::Error:
> DBPROCESS is dead or not enabled
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/adapters/tinytds.rb:74:in
> `execute'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/adapters/tinytds.rb:74:in
> `block (2 levels) in execute'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/database/logging.rb:43:in
> `log_connection_yield'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/adapters/tinytds.rb:73:in
> `block in execute'
>
>  
> /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/connection_pool/threaded.rb:88:in
> `hold'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/database/connecting.rb:269:in
> `synchronize'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/adapters/tinytds.rb:47:in
> `execute'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/dataset/actions.rb:1093:in
> `execute'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/adapters/tinytds.rb:215:in
> `fetch_rows'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/dataset/actions.rb:152:in
> `each'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/dataset/actions.rb:444:in
> `map'
>
>  /usr/local/bundle/gems/sequel-5.45.0/lib/sequel/dataset/actions.rb:444:in
> `map'
>     /usr/local/bundle/gems/rom-core-5.2.5/lib/rom/relation.rb:223:in `each'
>     /usr/local/bundle/gems/rom-core-5.2.5/lib/rom/relation.rb:363:in `each'
>     /usr/local/bundle/gems/rom-core-5.2.5/lib/rom/relation.rb:363:in `to_a'
>     /usr/local/bundle/gems/rom-core-5.2.5/lib/rom/relation.rb:363:in `to_a'
>     /app/app/lib/repositories/ai_records_repo.rb:14:in `all_filtered'
>
> The ConnectionValidator-plugin is enabled.
>
> container = ROM.container(configuration)
> container.gateways[:default].connection.extension(:connection_validator)
>

You may want to set the connection validation timeout. The default is an
hour, which may be too long for your case.  You can set it to check for
validity after than one minute idle using:

 container.gateways[:default].connection.pool.connection_validation_timeout
= 60

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CADGZSSeismb8Rci05d1Bxoz%3DibiT9pX0sagQyEN%2BmoGSwnABYw%40mail.gmail.com.

Reply via email to