You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Tobias SCHOESSLER <To...@unvienna.org> on 2006/07/26 13:39:01 UTC

Clear DataContext Cache

Hello,

In cayenne 1.1.3 is it possible to clear the object cache of a DataContext
manually?
I do not want to recreate the DataContext as it is being used in several
controllers that would otherwise need to be refreshed.

thanks.




Re: Clear DataContext Cache

Posted by Mike Kienenberger <mk...@gmail.com>.
I use this in my Cayenne 1.1 project.

            dataContext.invalidateObjects(dataContext.getObjectStore().getObjects());

In my 1.1 junit tests, I go even farther:

        getDataContext().rollbackChanges();
        getDataContext().invalidateObjects(getDataContext().getObjectStore().getObjects());
        getDataContext().getObjectStore().getDataRowCache().clear();

-Mike


On 7/26/06, Gentry, Michael (Contractor) <mi...@fanniemae.com> wrote:
> Man, 1.1.3 is like ... so last week.  :-)
>
> Would DC's unregisterObjects() or invalidateObjects() do what you want?
> (I think those were available in 1.1.3.)
>
> /dev/mrg
>
>
> -----Original Message-----
> From: Tobias SCHOESSLER [mailto:Tobias.Schoessler@unvienna.org]
> Sent: Wednesday, July 26, 2006 7:39 AM
> To: cayenne-user@incubator.apache.org
> Subject: Clear DataContext Cache
>
>
>
> Hello,
>
> In cayenne 1.1.3 is it possible to clear the object cache of a
> DataContext
> manually?
> I do not want to recreate the DataContext as it is being used in several
> controllers that would otherwise need to be refreshed.
>
> thanks.
>
>
>
>

Re: Clear DataContext Cache

Posted by Andrus Adamchik <an...@objectstyle.org>.
Yeah, unregisterObjects() should do the trick.

A.


On Jul 26, 2006, at 9:38 AM, Gentry, Michael ((Contractor)) wrote:

> Man, 1.1.3 is like ... so last week.  :-)
>
> Would DC's unregisterObjects() or invalidateObjects() do what you  
> want?
> (I think those were available in 1.1.3.)
>
> /dev/mrg
>
>
> -----Original Message-----
> From: Tobias SCHOESSLER [mailto:Tobias.Schoessler@unvienna.org]
> Sent: Wednesday, July 26, 2006 7:39 AM
> To: cayenne-user@incubator.apache.org
> Subject: Clear DataContext Cache
>
>
>
> Hello,
>
> In cayenne 1.1.3 is it possible to clear the object cache of a
> DataContext
> manually?
> I do not want to recreate the DataContext as it is being used in  
> several
> controllers that would otherwise need to be refreshed.
>
> thanks.
>
>
>
>


RE: Clear DataContext Cache

Posted by "Gentry, Michael (Contractor)" <mi...@fanniemae.com>.
Nothing at all wrong with using 1.1.3.  :-)



-----Original Message-----
From: Tobias SCHOESSLER [mailto:Tobias.Schoessler@unvienna.org] 
Sent: Wednesday, July 26, 2006 10:57 AM
To: cayenne-user@incubator.apache.org
Cc: cayenne-user@incubator.apache.org
Subject: RE: Clear DataContext Cache


... yes oldschool, ... but they say - never change a runing system. : )


I call

      dataContext
.unregisterObjects(dataContext.getObjectStore().getObjects());

that helped.

thanks



 

             "Gentry, Michael

             \(Contractor\)"

             <michael_gentry@f
To 
             anniemae.com>
<ca...@incubator.apache.org> 
 
cc 
             Wednesday, 26

             July 2006 15:38
Subject 
                                       RE: Clear DataContext Cache

 

             Please respond to

             cayenne-user@incu

             bator.apache.org

 

 





Man, 1.1.3 is like ... so last week.  :-)

Would DC's unregisterObjects() or invalidateObjects() do what you want?
(I think those were available in 1.1.3.)

/dev/mrg


-----Original Message-----
From: Tobias SCHOESSLER [mailto:Tobias.Schoessler@unvienna.org]
Sent: Wednesday, July 26, 2006 7:39 AM
To: cayenne-user@incubator.apache.org
Subject: Clear DataContext Cache



Hello,

In cayenne 1.1.3 is it possible to clear the object cache of a
DataContext
manually?
I do not want to recreate the DataContext as it is being used in several
controllers that would otherwise need to be refreshed.

thanks.






RE: Clear DataContext Cache

Posted by Tobias SCHOESSLER <To...@unvienna.org>.
... yes oldschool, ... but they say - never change a runing system. : )


I call

      dataContext
.unregisterObjects(dataContext.getObjectStore().getObjects());

that helped.

thanks



                                                                           
             "Gentry, Michael                                              
             \(Contractor\)"                                               
             <michael_gentry@f                                          To 
             anniemae.com>             <ca...@incubator.apache.org> 
                                                                        cc 
             Wednesday, 26                                                 
             July 2006 15:38                                       Subject 
                                       RE: Clear DataContext Cache         
                                                                           
             Please respond to                                             
             cayenne-user@incu                                             
             bator.apache.org                                              
                                                                           
                                                                           




Man, 1.1.3 is like ... so last week.  :-)

Would DC's unregisterObjects() or invalidateObjects() do what you want?
(I think those were available in 1.1.3.)

/dev/mrg


-----Original Message-----
From: Tobias SCHOESSLER [mailto:Tobias.Schoessler@unvienna.org]
Sent: Wednesday, July 26, 2006 7:39 AM
To: cayenne-user@incubator.apache.org
Subject: Clear DataContext Cache



Hello,

In cayenne 1.1.3 is it possible to clear the object cache of a
DataContext
manually?
I do not want to recreate the DataContext as it is being used in several
controllers that would otherwise need to be refreshed.

thanks.






RE: Clear DataContext Cache

Posted by "Gentry, Michael (Contractor)" <mi...@fanniemae.com>.
Man, 1.1.3 is like ... so last week.  :-)

Would DC's unregisterObjects() or invalidateObjects() do what you want?
(I think those were available in 1.1.3.)

/dev/mrg


-----Original Message-----
From: Tobias SCHOESSLER [mailto:Tobias.Schoessler@unvienna.org] 
Sent: Wednesday, July 26, 2006 7:39 AM
To: cayenne-user@incubator.apache.org
Subject: Clear DataContext Cache



Hello,

In cayenne 1.1.3 is it possible to clear the object cache of a
DataContext
manually?
I do not want to recreate the DataContext as it is being used in several
controllers that would otherwise need to be refreshed.

thanks.