Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Connection pooling & schema cache issue
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
blambeau  
View profile  
 More options Sep 22 2012, 2:54 am
From: blambeau <blamb...@gmail.com>
Date: Fri, 21 Sep 2012 23:54:58 -0700 (PDT)
Local: Sat, Sep 22 2012 2:54 am
Subject: Re: Connection pooling & schema cache issue

Thanks Jeremy, that explain the behavior I'm observing!

I indeed expected "schema_cache" to apply to everything related to the
relational database schema, not only the table `signature`s (let say). The
fact is that my business logic systematically needs information about keys
and indexes. I'll keep them in a cache myself!

Bernard

On Saturday, September 22, 2012 12:19:47 AM UTC+2, Jeremy Evans wrote:

> 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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.