[Backgroundrb-devel] Session access interfers with other modelaccess
Bill Walton
bill.walton at charter.net
Tue Oct 17 16:52:20 EDT 2006
Update...
I explicitly generated a Session model and that made things a little better.
I can uncomment the lines below and now the Emrec DOES get deleted.
However, if I try to also delete the Session record, neither gets deleted.
Any ideas what gives?
Thanks,
Bill
----- Original Message -----
From: "Bill Walton" <bill.walton at charter.net>
To: "BackgroundRb" <backgroundrb-devel at rubyforge.org>
Sent: Tuesday, October 17, 2006 3:21 PM
Subject: [Backgroundrb-devel] Session access interfers with other
modelaccess
> Sorry to be such a bother but I'm not getting this.
>
> I have two models: Emrec and Session (I'm using AR for session mgmt.) In
> my
> worker I can access the Emrec model and delete a record, AS LONG AS I
> don't
> try to access the Session model. With the Session model access commented
> out as below, the Emrec record gets deleted. If I uncomment those lines,
> the Emrec record is _not_ deleted. Any idea what I'm doing wrong?
>
> Thanks,
> Bill
>
>
> In my controller...
>
> @session_id = session.session_id
> session[:job_key] = MiddleMan.new_worker(:class => :foo_worker,
> :args => {:emrec_id =>
> @emrec.id,
> :session_id =>
> @session_id})
>
>
> In my worker...
>
> def do_work(args)
> @time_remaining = 7
> @emrec_id = args[:emrec_id]
>
> #@session_rec = Session.find(:first,
> # :conditions => ["sessid = ?",
> args[:session_id]])
>
> calculate_the_meaning_of_life(args)
> Emrec.delete(@emrec_id)
> end
> _______________________________________________
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>
More information about the Backgroundrb-devel
mailing list