On Thursday, April 27, 2017 at 7:18:51 AM UTC-7, Samuel Nilsson wrote: > > Hi! > > First of all, thanks for a great gem with great documentation and great > support! I recently sent a pull request which was merged with support for > Oracle via ODBC. I use this to connect directly to our ERP system from a > Ruby application. Now and then I started getting weird error messages from > the ODBC Driver (unixODBC) and after a lot of investigation I came to the > conclusion that the error message really was related to the read timeout > being expired. > > So I started digging into the implementation of the connection pool. The > first thing I tried was to go single-threaded but that didn't solve the > problem. Eventually I implemented my own connection pool which simply > *always* closed the connection explicitly after having sent a query. This > works but it feels awkward, especially since our ERP provider claims that > it should be possible to send more than one query per session. The problem > seem to be that the current implementation of the connection pool holds > connection(s) but never understands when a connection is dead and just > raises an exception. Is there something I'm missing here? >
It's likely the odbc/oracle adapter doesn't recognize the exception as a disconnect error, and therefore won't remove the connection from the pool. You probably need to implement Database#disconnect_error? appropriately in the adapter. See other adapters for examples. If you could provide the exception class and exception message, I should be able to implement an appropriate disconnect_error? method. Also, you may want to look into the connection_validator extension. 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 post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
