Sounds like you want to use cache regions instead.

On Sun, Oct 5, 2008 at 5:37 AM, jason.hill <[EMAIL PROTECTED]> wrote:

>
> My requirement is to handle the case of a batch process updating
> domain data and the need to subsequently ensure that interative users
> have the most recent data. The batch process sends an email to users
> upon completion informing them of updates to their account data. This
> email often prompts users to log back in and check out the updates so
> they must have a current view of the data.
>
> So, it feels appropriate to cache this data to gain the performance
> improvement for interactive users and then to just clear them from the
> cache at the end of the batch process. I have set it up to Evict all
> the classes, subclasses and collections that are touched by the batch
> process and it seems to be working perfectly.
>
> Fabio: would you see this as being an appropriate use of Evict?
>
> Jason
>
>
> On Oct 5, 5:03 am, "Fabio Maulo" <[EMAIL PROTECTED]> wrote:
> > When you have so much evict you must ask you:1) my Cache is well
> configured
> > ? (regions, mode, expiration...)
> > 2) do I really need that entity in the Cache ?
> >
> > When you have so much evict for Session-Cache (aka first-level-cache),
> you
> > must ask you:
> > 1) do I manage the session as this use-case need ?
> > 2) do I need a stateLessSession ?
> >
> > The use of Evict is acceptable in some, few, very special cases and an
> > extensive use of it is a symptom of some other problem.
> >
> > 2008/10/4 Jesse <[EMAIL PROTECTED]>
> >
> >
> >
> >
> >
> >
> >
> > > 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
> >
> > --
> > Fabio Maulo- Hide quoted text -
> >
> > - Show quoted text -
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to