On Friday, September 21, 2012 7:04:05 AM UTC-7, blambeau wrote: > > Hi guys, > > I'm facing a little issue with Sequel in a Sinatra application (ran with > thin). > > My logs show that a new database connection seems created and > catalog-related queries sent for every request (so, no schema cache at > all). I've checked that the same ::Sequel::Database instance is used for > every request. >
This isn't typical behavior, Database#schema does caching by default, unless you set Database#cache_schema = false. Alternatively, if you are creating a new Database object every request, your behavior is expected. You should generally assign your Database object to a constant so that doesn't occur. It is expected that Database#tables, Database#table_exists?, and Database#indexes are not cached. It's rare that those are called repeatedly, you should do manual caching in your app in those cases. 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/-/5fc9Wzh1ii4J. 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.
