Hi Morten,
glad you could make this work for you.
I'm not sure why you're seeing this strange behaviour, I've never seen
this happen before.
Cheers,
Jens
On Mon, Nov 12, 2007 at 03:22:33PM +0100, Morten wrote:
>
> The underlying problem is bad unmarshalling of the Ferret::Document that
> gets sent to the DRb server.
>
> In ferret_server.rb:
>
> rescue NoMethodError
> @logger.debug "no luck, trying to call class method instead"
>
> Using rescue NoMethodError => e and then include e.message in the debug
> output, reveals:
>
> undefined method `to_doc' for #<DRb::DRbUnknown:0x2a9808f3f0>
>
> I'm pretty blank as to why Ferret::Document does not get properly
> unmarshalled on the initial request. If I change the add method to
> attempt a DRb reload in local_index.rb (line ~139):
>
> def add(record)
> if record.is_a?(DRb::DRbUnknown)
> record = record.reload
> logger.warn("Reloaded DRb::DRbUnknown to #{record.class.name}")
> end
>
> record = record.to_doc unless Hash === record || Ferret::Document ===
> record
> ferret_index << record
> end
>
> Then I do indeed get a Document instance back, ie. I have a work around.
>
> But why does this work around work? Does the unmarshalling process occur
> before the relevant classes get loaded in the initial request?
>
> I'll patch up my local AAF to use this work around, but as it does not
> solve the actual root problem, I guess it's not interesting as a patch
> submission.
>
> Br,
>
> Morten
>
>
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
>
--
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk