I agree with you Fabio. Evict doesnt work quite as you would expect
it to from a user standpoint though. For example, I have a rental
queue that can be cached with a line items collection that is also
cached. If I evict the RentalQueue, the cached collection is left in
cache. If I evict the collection then each line item is still cached.
So to evict everything related to the rental queue, I must first evict
each line item, then the collection, then finally the queue. From the
developers point of view this a pain.
You may ask, why would i want to do something like this. Well each
line item has a version column and so does the rental queue itself. If
I get a stale object exception when updating one of the line items I
just want to evict the whole rental queue from the cache.
Seems like we should be able to make this process a little easier or
more intuitive.
Jesse
On Oct 4, 5:13 am, "Fabio Maulo" <[EMAIL PROTECTED]> wrote:
> hmmmm.... too much extensive use of Evict...
>
> 2008/10/3 jason.hill <[EMAIL PROTECTED]>
>
>
>
>
>
> > Excellent...thanks again.
>
> > Do I need to evict the association class as well as the collection,
> > e.g.
>
> > Evict(Parent)
> > EvictCollection("Parent.Children")
> > Evict(Child)
>
> > Also, if I evict an abstract base class, will all subclasses be
> > evicted automatically or do I have to evict each one separately, e.g.
>
> > Evict(Parent)
> > Evict(SuperParent)
> > Evict(SuperDuperParent)
>
> > On Oct 4, 8:32 am, "Ayende Rahien" <[EMAIL PROTECTED]> wrote:
> > > no, for that you need EvictCollection
>
> > > On Sat, Oct 4, 2008 at 1:26 AM, jason.hill <[EMAIL PROTECTED]>
> > wrote:
>
> > > > Thanks.
>
> > > > Just to confirm...this will also evict associations where I have
> > > > cascade="all" or "all-delete-orphan"...right?
>
> > > > On Oct 3, 6:32 pm, "Ayende Rahien" <[EMAIL PROTECTED]> wrote:
> > > > > sessionFactory.Evict()
>
> > > > > On Fri, Oct 3, 2008 at 7:55 AM, jason.hill <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > > Hi,
>
> > > > > > I have a web app with the second level cache turned on. I then have
> > a
> > > > > > batch job that runs as part of task scheduler intermittently
> > > > > > throughout the day to process some stuff against the domain.
>
> > > > > > At the end of the batch job, I want to trigger a clearing of the
> > > > > > second level cache in the web app so that interactive users will
> > > > > > always be looking at the current data from the DB. What is the best
> > > > > > way to do this?
>
> > > > > > I know I can recycle the app pool but then it can disrupt users
> > that
> > > > > > are already logged in, forcing them to login again so that is not
> > an
> > > > > > option. I am assuming that I will need to programatically submit a
> > web
> > > > > > request against the application to clear the cache manually. Is
> > that
> > > > > > right? How do you manually clear the cache though?
>
> > > > > > Thanks,
>
> > > > > > Jason- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---