On Tue, Nov 14, 2006 at 12:44:57PM +0100, Roger wrote:> I have a model called "Business". Each object say @business can
be
> tagged by any user. When i do ferret update for this object(on adding a
> new tag or editing it), there always a possibility that another user is
> also tagging it. I am using the std rails pluggin for tagging
> ''acts_as_taggable''.
>
> So is the indexing done properly. Or would there be any problem?
There is no transaction support of any kind in Ferret itself.
The worst thing that might happen in your example is the typical ''lost
update'' thing - users A and B both tag the same object, and B
overwrites
A''s tags with his own. Without optimistic locking this will probably
even
happen to your database records, depending on how acts_as_taggable does
it''s tagging.
With optimistic locking the DB call will fail, and any after_create
hooks will be skipped - if you use acts_as_ferret or do your indexing
manually in an after_create hook, it shouldn''t get called in this case.
cheers,
Jens
--
webit! Gesellschaft f?r neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de
Schnorrstra?e 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66