On Monday, September 24, 2012 7:09:12 AM UTC-7, Christoffer Sawicki wrote: > > I use this Rack middleware to make sure HTTP requests don't get a dead > database connection: > > http://pastie.org/private/sn73uvvr4vzm1z7x4pcsdg > > Pretty useful in normal web applications. >
Note that in a threaded environment, your middleware may not work correctly. It's possible for @db.run in your middleware to use a different connection then your application code will use. If you want to ensure they use the same connection, you need to surround your @db.run and @app.call code in a @db.synchronize block. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/YSOcmYxnE0wJ. 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.
