--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
> "The NH cache is for objects retrieved by NH"
>
> I understand that. What confuses me is that somebody wrote an API to take
> things out of that cache without writing an API to put things into it.
>
> Why allow the ability to take something out of that cache? Somebody had
> justification for writing such a function back in the day.
The caching mechanism is in the o/r mapper, it's FOR the o/r mapper,
when it materializes entity class instances with the data from the db. So
objects end up in the cache because the o/r mapper decided to do so.
It can be you need to remove an object from the cache, because you
removed it from the db using other means, e.g. a trigger, a separate process
on another machine, you name it. This way you can, in case of emergency,
remove it. I think that's the reason behind this method but we can only
guess, we didn't write the method. I agree that it's not a shiny example of
proper design, but NHibernate has plenty of that kind of hodgepodge stuff,
added during the years, as it's a framework which exists for a long time
(and inherited it from the Java version)
> So, isn't that same justification viable for a reason to be able to stuff
> something into that cache? Even better yet a
> SessionFactory.Replace(object) would be perfect, because I just need to
take
> the new copy of Object A and overwrite the old Object A and have that new
> Object A be the master.
that would mean you'd place yourself on the seat of the o/r mapper
which decides when to keep objects in the cache. That's not your job, leave
that to the o/r mapper. If you want to use a cache for your objects, use ...
a cache :) The l2 cache here is out of reach so use another one.
> "If you are getting it from other source, you can cache it yourself using
> the same underlying cache (syscache, memcached, etc)"
>
> I'm not sure what you mean. Are you saying there is a way to stuff an
> object into the L2 cache? If so, how do I get at the SessionFactory's
> underlying memory structure that is used to implement that cache? Or, are
> you saying that I should implement my own cache, separate from
> SessionFactory? In that case, what good would it do, because
SessionFactory
> wouldn't be aware that I have a separate cache where it could find objects
> instead of selecting them.
the underlying caching system used for l2 caching is the one you can
add the object to yourself, that's what was meant.
FB
>
> Thanks for your help.
> Hugh
>
Apparently no-one else is mature enough to answer this guy's questions, so
let me give it a try.
No offence Fabio, but:
> Man!... too many words and few facts!
> be Nike!
and (Diego)
> NHibernate is like a screwdriver. All your emails today can be reduced to
"why is it so hard > to hammer nails with it?"
why bother replying then? It's really easy: why reply to the person
with the question with answers like the ones above? If the user asks a
question not worth answering, why not simply ignore it? This happens on this
mailinglist anyway.
It's very easy to help users AND be nice. They _care_ about your
work otherwise they'd dump it and move to something else.
FB
No offence Fabio, but:
> On Thu, Aug 5, 2010 at 4:21 AM, Frans Bouma <fr...@sd.nl> wrote:> NHibernate is like a screwdriver. All your emails today can be reduced to
"why is it so hard > to hammer nails with it?"why bother replying then? It's really easy: why reply to the person
with the question with answers like the ones above? If the user asks a
question not worth answering, why not simply ignore it? This happens on this
mailinglist anyway.
It's very easy to help users AND be nice. They _care_ about your
work otherwise they'd dump it and move to something else.
FB
Wouldn't the cache (assuming distributed here) have already been
updated when user 4 saved to the db and published the notification?
Greg
--
Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer
de votre attention
> --
> You received this message because you are subscribed to the Google Groups "nhusers" group.
> To post to this group, send email to nhu...@googlegroups.com.
> To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
>
>
--