[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: ActiveRecord through Drb: problem with ids

Ezra Zygmuntowicz

8/25/2006 5:29:00 PM


On Aug 25, 2006, at 9:23 AM, Philippe Lang wrote:

> ara.t.howard@noaa.gov wrote:
>> On Fri, 25 Aug 2006, Philippe Lang wrote:
>>
>>> obj = DRbObject.new(nil, 'druby://localhost:9000')
>>>
>>> g = obj.find(1)
>>> puts "#{g.id} | #{g.name}"
>>> g.flowers.each do |f|
>>> puts "#{f.id} | #{f.garden_id} | #{f.name}"
>>> end
>>> ------------------------------------------------------
>>>
>>>
>>> ... I get:
>>>
>>> ------------------------------------------------------
>>> ar_client.rb:8: warning: Object#id will be deprecated; use
>>> Object#object_id 67884862 | garden1
>>> ar_client.rb:10: warning: Object#id will be deprecated; use
>>> Object#object_id 67882632 | 1 | flower1
>>> ar_client.rb:10: warning: Object#id will be deprecated; use
>>> Object#object_id 67880122 | 1 | flower2
>>> ------------------------------------------------------
>>
>> certain methods are treated specially by drb. it was a
>> mistake for rails to override Object#id for exatly this kind
>> of scenario - many peice of code require it.
>>
>> you need to do something like
>>
>> class << ActiveRecord
>> alias "id__", "id"
>> end
>
> Hi,
>
> Thanks for your answer. I see now where the problem comes from, but
> your "trick" is apparently not sufficient. The code...
>
> class Garden < ActiveRecord::Base
> include DRbUndumped
> has_many :flowers
> alias :id__ :id
> end
>
> class Flower < ActiveRecord::Base
> include DRbUndumped
> belongs_to :garden
> alias :id__ :id
> End
>
> ... Still does not work...


Hey Philip-

I have dealt alot with ActiveRecord over drb, I use it in this
plugin for rails[1] . The way around this is to use a different
notation to get the id of the AR object. So with your client example
change it to this and you will be fine:

#!/usr/local/bin/ruby
require 'drb'

DRb.start_service()
obj = DRbObject.new(nil, 'druby://localhost:9000')

g = obj.find(1)
puts "#{g[:id]} | #{g.name}"
g.flowers.each do |f|
puts "#{f[:if]} | #{f[:id]} | #{f.name}"
end

So by using arinstance[:id] instead of arinstance.id you will avoid
this problem all together.

Cheers-
-Ezra

[1] http://backgroundrb.rub...








8 Answers

RS

6/16/2012 6:56:00 PM

0

On Sat, 16 Jun 2012 11:37:08 -0700 (PDT), thomas
<drthomasfbrown@gmail.com> wrote:

>On Friday, June 15, 2012 10:35:11 AM UTC-4, Tony Elka wrote:
>>
>> Anyone else ever get tired of virtuosity for it's own sake?

> Yes. However, the alternative hypothesis is that the fatigued listener
> lacks the ear to really hear what's going on amongst all the chops.
> For example, I can't take much of Allan Holdsworth, but I acknowledge
> that he can hear way more than I can.

I've known people who claim to have walked out of Holdsworth shows
(the "Too many notes" scene in Amadeus comes to mind :-) but become
fans after a while. I certainly love him. But I do think Holdsworth
may make a better subject for the 'virtuosity' question, as I've never
thought of Dimeola as a virtuoso. Where Holdsworth can be
overwhelming, there's depth and harmonic knowledge there; not just
chops. Dimeola, by contrast, feels like submersion in 'white note
soup'.

RS

6/16/2012 7:02:00 PM

0

On Sat, 16 Jun 2012 11:42:05 -0700, Tony Elka
<shadowlane@shadowlane.com> wrote:

>In article <8eb5e203-e537-4883-a41d-223e469d1f29@googlegroups.com>,
> thomas <drthomasfbrown@gmail.com> wrote:
>
>> On Friday, June 15, 2012 10:35:11 AM UTC-4, Tony Elka wrote:
>> >
>> > Anyone else ever get tired of virtuosity for it's own sake?
>>
>> Yes. However, the alternative hypothesis is that the fatigued listener lacks
>> the ear to really hear what's going on amongst all the chops. For example, I
>> can't take much of Allan Holdsworth, but I acknowledge that he can hear way
>> more than I can.
>
>
>When I saw Bill Bruford back in 1980, touring the album "One of a Kind"
>everybody from that album was on stage EXCEPT Allan Holdsworth, so I
>have yet to see him perform live.
>
>Tony

Since you're a keyboard player, you may appreciate Holdsworth's
recordings with Allan Pasqua. That would include the debut "Believe
It" with Tony Williams, of course. But he did a tour and double live
CD recently that highlights Pasqua's sense for orchestration and pure
sound. I saw them a couple times on that tour and came away absolutely
floored by Pasqua as a musician.

http://www.allmusic.com/album/blues-for-tony-mw...

And of course Holdsworth was OK too. :-)

Tony Elka

6/16/2012 7:28:00 PM

0

In article <fllpt79jrtj38q9pvls3i6jr58qgocj07m@4ax.com>,
RS <RS@nospam.com> wrote:

> Since you're a keyboard player, you may appreciate Holdsworth's
> recordings with Allan Pasqua. That would include the debut "Believe
> It" with Tony Williams, of course. But he did a tour and double live
> CD recently that highlights Pasqua's sense for orchestration and pure
> sound. I saw them a couple times on that tour and came away absolutely
> floored by Pasqua as a musician.
>
> http://www.allmusic.com/album/blues-for-tony-mw...



I'll check that out, thanks!

Tony

RS

6/16/2012 7:40:00 PM

0

On Sat, 16 Jun 2012 12:27:56 -0700, Tony Elka
<shadowlane@shadowlane.com> wrote:

>In article <fllpt79jrtj38q9pvls3i6jr58qgocj07m@4ax.com>,
> RS <RS@nospam.com> wrote:
>
>> Since you're a keyboard player, you may appreciate Holdsworth's
>> recordings with Allan Pasqua. That would include the debut "Believe
>> It" with Tony Williams, of course. But he did a tour and double live
>> CD recently that highlights Pasqua's sense for orchestration and pure
>> sound. I saw them a couple times on that tour and came away absolutely
>> floored by Pasqua as a musician.
>>
>> http://www.allmusic.com/album/blues-for-tony-mw...
>
>
>
>I'll check that out, thanks!
>
>Tony

For the record, that would be "Alan" Pasqua without the extra L.

RS

6/17/2012 7:42:00 AM

0

On Sat, 16 Jun 2012 12:27:56 -0700, Tony Elka
<shadowlane@shadowlane.com> wrote:

>In article <fllpt79jrtj38q9pvls3i6jr58qgocj07m@4ax.com>,
> RS <RS@nospam.com> wrote:
>
>> Since you're a keyboard player, you may appreciate Holdsworth's
>> recordings with Allan Pasqua. That would include the debut "Believe
>> It" with Tony Williams, of course. But he did a tour and double live
>> CD recently that highlights Pasqua's sense for orchestration and pure
>> sound. I saw them a couple times on that tour and came away absolutely
>> floored by Pasqua as a musician.
>>
>> http://www.allmusic.com/album/blues-for-tony-mw...
>
>
>
>I'll check that out, thanks!
>
>Tony

There are samples on that page. Check out "Fred", which was originally
done with the Tony Williams band ("Believe It" album). Gorgeous tune,
and Tony Williams really drives the original tune. Chad Wackerman is
great (the drummer on this recording), but he's mostly playing stuff
based on T.W's original parts. Of course that's only appropriate, as
the album is dedicated to Tony.

Claus Rogge

6/17/2012 11:07:00 AM

0

Am 16/06/12 21.01, schrieb RS:

> But he did a tour and double live
> CD recently that highlights Pasqua's sense for orchestration and pure
> sound. I saw them a couple times on that tour and came away absolutely
> floored by Pasqua as a musician.

They came by here too and I felt the same way. I think there?s a DVD out
there as well, "Live at Yoshi?s" or is that a bootleg?

> And of course Holdsworth was OK too. :-)

and Jimmy Haslip playing his RH six-string lefthanded - crazy! That was
a bunch of musicians.

Holdsworth and McLaughlin are the two guitarists that either don't play
licks or they know so many that I can?t hear it ...

--
New CD "Breaking Habits"
http://www.cdbaby.com/AlbumDetails.aspx?AlbumID=...
Music for free:
http://tinyurl....

Tony Elka

6/17/2012 5:00:00 PM

0

In article <o72rt7d7l8308nmercs81p15r5jdgvn8lb@4ax.com>,
RS <RS@nospam.com> wrote:

> There are samples on that page. Check out "Fred", which was originally
> done with the Tony Williams band ("Believe It" album). Gorgeous tune,
> and Tony Williams really drives the original tune. Chad Wackerman is
> great (the drummer on this recording), but he's mostly playing stuff
> based on T.W's original parts. Of course that's only appropriate, as
> the album is dedicated to Tony.


I saw Chad Wackerman at a club in L.A., it was essentially a night of
Zappa music, with everyone but the late Frank performing, including Ike
Willis.

Tony

RS

6/17/2012 8:28:00 PM

0

On Sun, 17 Jun 2012 13:06:41 +0200, Claus Rogge
<claus.rogge@SPAMTRAPaon.at> wrote:

>Am 16/06/12 21.01, schrieb RS:
>
>> But he did a tour and double live
>> CD recently that highlights Pasqua's sense for orchestration and pure
>> sound. I saw them a couple times on that tour and came away absolutely
>> floored by Pasqua as a musician.
>
>They came by here too and I felt the same way. I think there?s a DVD out
>there as well, "Live at Yoshi?s" or is that a bootleg?

That's a legitimate recording, Claus. Great to see Holdsworth's
fingers, for what that might be worth to anyone, as it's tough to
follow. What incredible, fluent moves.

>> And of course Holdsworth was OK too. :-)
>
>and Jimmy Haslip playing his RH six-string lefthanded - crazy! That was
>a bunch of musicians.

I'm usually not crazy about Haslip's tone ('puffy' scooped sound
favored by a lot of slap players), but he sounded great with that
band.

>Holdsworth and McLaughlin are the two guitarists that either don't play
>licks or they know so many that I can?t hear it ...

That's a very good point!