Thanks for the reply!

I don't think ENV['my_var'] will work in this case. I definitely need to
allow different users to submit requests at the same time. Here is what I am
doing now:

controller:
    ctl_file = 'db/etl/trans.ctl'
    usr_ctl_file = "db/etl/trans[#{current_user.id.to_s}].ctl"

    File.copy(ctl_file, usr_ctl_file)

    puts 'Current user is ' + current_user.id.to_s + ' (controller)'
    ETL::Engine.realtime_activity = true
    ETL::Engine.process(usr_ctl_file)

ctl:
    #parse the ctl file name and get the user id
    u = __FILE__.scan(/\[[0-9]+\]/)[0].gsub(/[\[\]]/,"").to_i
    puts 'Current user is: ' + u.to_s + ' (CTL file)'

It "works", but it isn't complete. I still need to set up the input and
temporary files to include the user id too. I also need to clean up all
these extra files.

This approach seems very crude. I was hoping that I could start the etl by
just calling a method such as MyCtl.start(user_id). (I don't mean this as a
criticism. I am far too new to ActiveWarehouse to criticize any design
decisions.)

Thanks for the help!
Paul


On Dec 29, 2007 5:05 AM, Thibaut Barrère <[EMAIL PROTECTED]> wrote:

> Hi Paul,
>
> > I am thinking that passing an argument/parameter would be the best way
> to do
> > this.
>
> the easiest way to pass variables to a ctl file is through
> ENV['myvar'] ; see
>
> http://rubyforge.org/pipermail/activewarehouse-discuss/2007-October/000184.html
> for a previous discussion on this topic.
>
> > Any suggestions?
>
> Yep - take care of concurrency issues if multiple users achieve a
> request at the same time, or things won't scale properly. One solution
> could be to:
> - do the processing for all users as part of a nightly process
> - and just achieve a request to the database, filtering by user_id
>
> Thibaut
> --
> http://evolvingworker : tools for a better day
>



-- 


Ezk. 36
_______________________________________________
Activewarehouse-discuss mailing list
Activewarehouse-discuss@rubyforge.org
http://rubyforge.org/mailman/listinfo/activewarehouse-discuss

Reply via email to