On Thursday, March 1, 2012 8:22:08 PM UTC-8, Nels Nelson wrote:
>
> I guess I simply cannot do what I am attempting to do.
>
> I re-forked the fork that you made, and made some adjustments to
> reflect what I am actually attempting to do.
>
> https://gist.github.com/1955486
>
> The non-persistent items (the string "Hi!" in this case) are simply
> not there in the second thread.
>
> Still, thank you for your help, Jeremy. I guess I will have to figure
> out how to create a thread safe hash that I store as a class variable
> somewhere, and key by entity instance or something. That just seems
> awful.
>
You could try just make the change to the identity_map plugin to use a
thread-safe global hash instead of a regular hash stored in a thread-local
variable (changing identity_map and identity_map=). But you are going to
have to use some sort of locking mechanism at the model instance level to
make sure that no thread is modifying an instance while another thread is
operating on it. I'd recommend writing a mutex plugin so you can do
model_instance.sync{...} for that.
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sequel-talk/-/oWrowt_BkZgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.