>
> I would certainly recommend against this approach.  If you do it
> anyway, you'll have to use a Rack middleware that does something like:
>

Seems more complicated than needs to be...I use Padrino/Sinatra
fronted by Passenger under Apache 2, which will only execute
single-threaded anyway (that is one connection per client) and the
following works for me:

Datacenter.controllers :reports, :parent => :schema do
  before do
    @current_schema = params[:schema_id].to_sym
    use_schema @current_schema
  end

use_schema is just a helper method defined as:

    def use_schema(schema)
      DB.execute("use #{schema}")
    end

I have about 30 users concurrently under this approach and there
hasn't been any issues with schemas getting inadvertently switched.
Works correctly with AJAX calls, too.

Michael
-- 
http://codeconnoisseur.org

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
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.

Reply via email to