It's weird that the IoC hits to the cache keep going up.

On Jun 28, 11:53 pm, Mark Mandel <[email protected]> wrote:
> It * sounds * like Transfer is being loaded on every request... I would put
> some <cflog> statements in TransferFactory's init() function, and see if
> that is the case.
>
> Mark
>
> On Mon, Jun 29, 2009 at 4:35 PM, whostheJBoss 
> <[email protected]>wrote:
>
>
>
>
>
> > Ok, a few things. I will explain my configuration first.
>
> > I have my Transfer wired up in ColdBox via the Transfer Loader
> > interceptor:
>
> >   <!-- Transfer Loader -->
> >   <Interceptor class="coldbox.system.extras.transfer.TransferLoader">
> >   <Property name="ConfigPath">/${AppMapping}/config/transfer.xml.cfm</
> > Property>
> >    <Property name="definitionPath">/${AppMapping}/config/definitions</
> > Property>
> >    <Property name="datasourceAlias">MyDataSource</Property>
> >   </Interceptor>
>
> > This loads Transfer, TransferTransaction and TransferFactory into the
> > ColdBox OCM at application startup.
>
> > My ColdSpring configuration is set to retrieve Transfer and its
> > associated beans from the OCM:
>
> > <!-- Define Transfer to be used as a bean -->
> > <bean id="Transfer" factory-bean="ColdboxOCM" factory-method="get">
> >   <constructor-arg name="objectKey"><value>Transfer</value></
> > constructor-arg>
> > </bean>
> > <bean id="TransferTransaction" factory-bean="ColdboxOCM" factory-
> > method="get">
> >   <constructor-arg name="objectKey"><value>TransferTransaction</
> > value></constructor-arg>
> > </bean>
> > <bean id="TransferFactory" factory-bean="ColdboxOCM" factory-
> > method="get">
> >   <constructor-arg name="objectKey"><value>TransferFactory</value></
> > constructor-arg>
> > </bean>
>
> > I have IoC caching off and handler caching disable in my ColdBox
> > configuration.
>
> > When I load up my app for the first time and then visit the view page,
> > it takes a few seconds (generating objects, etc) and then loads. After
> > that, any subsequent visits load nearly instantly, so the objects must
> > already be ready.
>
> > For my transfer.xml.cfm I have:
>
> >   <objectCache>
> >      <defaultcache>
> >         <scope type="instance" />
> >      </defaultcache>
> >   </objectCache>
>
> > That is the only reference to caching. Since transfer is loaded into
> > the OCM by the Transfer Loader interceptor, that is the instance where
> > the objects should be cached, right?
>
> > So...
>
> > 1.) I check the ColdBox cache for hits and I see that the IoC gets
> > hits when I refresh my view page but the ColdBox OCM cache for
> > Transfer stays at 2. Every time I refresh the view page, the IoC in
> > the ColdBox cache goes up. So, I was wondering how this works. If
> > Transfer is loaded into the ColdBox cache as Transfer, it shows 2 hits
> > and never changes, but everytime I call instance.Transfer.get() from
> > one of my handlers (instance.Transfer is injected from ColdSpring
> > which is wired to the OCM) the IoC hits go up but the Transfer hits
> > stay at 2. So, do I have a copy of Transfer in the IoC or what? Is the
> > one being injected by ColdSpring the one from the cache but the hits
> > are just being recorded in the IoC hit counter?
>
> > 2.) I set a variable rc.cache = getPlugin("ioc").getBean
> > ("TransferFactory").getTransfer().getCacheMonitor().getCachedClasses
> > ();
>
> > And the result is always an empty array. When I load my pages after
> > the first time they are fast, so they must be cached somewhere.
>
> > Any ideas?
>
> > On Jun 28, 5:56 pm, Mark Mandel <[email protected]> wrote:
> > > Oh yeah.. what's your cache config?
>
> > > Mark
>
> > > On Mon, Jun 29, 2009 at 10:49 AM, whostheJBoss
> > > <[email protected]>wrote:
>
> > > > I reload the app on the first request to make sure it's fresh, but no
> > > > reinits after that.
>
> > > > I have a page that does a view of all of my user objects and a page
> > > > that creates them.
>
> > > > The first time I hit the view page it takes a second or two, so I know
> > > > it's loading things up. Any hit after that loads almost instantly, so
> > > > the objects must already be ready.
>
> > > > I'm on Railo 3.1.0.017 on CentOS 5.3
>
> > > > I know there are some Railo issues, but I've managed to fix most of my
> > > > issues I believe.
>
> > > > On Jun 28, 5:36 pm, Mark Mandel <[email protected]> wrote:
> > > > > Should there be anything in there?
>
> > > > > Are you reloading your CB app on every request?
>
> > > > > What platform are you on?
>
> > > > > Mark
>
> > > > > On Mon, Jun 29, 2009 at 10:33 AM, whostheJBoss
> > > > > <[email protected]>wrote:
>
> > > > > > I'm having an issue with the cache and I can't seem to figure out
> > what
> > > > > > the problem is.
>
> > > > > > I'm using ColdBox / ColdSpring/ Transfer and loading Transfer as a
> > > > > > ColdSpring Bean into the instance scope of one of my handlers from
> > the
> > > > > > ColdBox cache.
>
> > > > > > So:
>
> > > > > > <!-- Define Transfer to be used as a bean -->
> > > > > > <bean id="Transfer" factory-bean="ColdboxOCM" factory-method="get">
> > > > > >   <constructor-arg name="objectKey"><value>Transfer</value></
> > > > > > constructor-arg>
> > > > > > </bean>
>
> > > > > > I then call instance.Transfer.get() or save(), etc inside of the
> > > > > > handler and it works fine. It loads a little slowly the first time
> > > > > > while creating the object, but subsequent requests load fast, so
> > I'm
> > > > > > assuming they are cached.
>
> > > > > > However, if I do this:
>
> > > > > > rc.cacheTest =
> > instance.Transfer.getCacheMonitor().getCachedClasses();
>
> > > > > > And then dump the rc.cacheTest variable it always shows up as an
> > empty
> > > > > > array.
>
> > > > > > instance.Transfer.getCacheMonitor().getTotalCalculatedSize() always
> > > > > > shows up as 0
>
> > > > > > Why is my Transfer cache not showing anything?
>
> > > > > --
> > > > > E: [email protected]
> > > > > T:http://www.twitter.com/neurotic
> > > > > W:www.compoundtheory.com
>
> > > --
> > > E: [email protected]
> > > T:http://www.twitter.com/neurotic
> > > W:www.compoundtheory.com
>
> --
> E: [email protected]
> T:http://www.twitter.com/neurotic
> W:www.compoundtheory.com
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" 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/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to