Flushing the Entity Engine cache ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Flushing the Entity Engine cache ?

Grant Edwards-2
Hi

My process is as follows:

1) Log an entity to the db reconrding job start time and some status
2) Run the job
3) Update the entity from step 1) with job end time and further status
requirements


The first two step run with out a problem, but step 3 throws the exception
seen below. Is it possible to do something like flush the entity cache after
step 1 ?


---- exception report
----------------------------------------------------------
Service [updateJobLogEntry] threw an unexpected exception/error
Exception: org.ofbiz.service.GenericServiceException
Message: Service target threw an unexpected exception (This object has been
flagged as immutable (unchangeable), probably because it came from an Entity
Engine cache. Cannot set a value in an immutable entity object.)
---- stack trace
---------------------------------------------------------------


Kinds regard

Grant e
Reply | Threaded
Open this post in threaded view
|

Re: Flushing the Entity Engine cache ?

David E Jones

If you're doing an update you should never read from the cache. It  
used to be possible and caused lots of problems, so we added the error  
message you are seeing.

-David


On Feb 7, 2008, at 1:04 PM, Grant Edwards wrote:

> Hi
>
> My process is as follows:
>
> 1) Log an entity to the db reconrding job start time and some status
> 2) Run the job
> 3) Update the entity from step 1) with job end time and further status
> requirements
>
>
> The first two step run with out a problem, but step 3 throws the  
> exception
> seen below. Is it possible to do something like flush the entity  
> cache after
> step 1 ?
>
>
> ---- exception report
> ----------------------------------------------------------
> Service [updateJobLogEntry] threw an unexpected exception/error
> Exception: org.ofbiz.service.GenericServiceException
> Message: Service target threw an unexpected exception (This object  
> has been
> flagged as immutable (unchangeable), probably because it came from  
> an Entity
> Engine cache. Cannot set a value in an immutable entity object.)
> ---- stack trace
> ---------------------------------------------------------------
>
>
> Kinds regard
>
> Grant e

Reply | Threaded
Open this post in threaded view
|

Re: Flushing the Entity Engine cache ?

Grant Edwards-2
Thank you, just had another look at the code and was using
findByPrimaryCache

On Feb 7, 2008 10:20 PM, David E Jones <[hidden email]> wrote:

>
> If you're doing an update you should never read from the cache. It
> used to be possible and caused lots of problems, so we added the error
> message you are seeing.
>
> -David
>
>
> On Feb 7, 2008, at 1:04 PM, Grant Edwards wrote:
>
> > Hi
> >
> > My process is as follows:
> >
> > 1) Log an entity to the db reconrding job start time and some status
> > 2) Run the job
> > 3) Update the entity from step 1) with job end time and further status
> > requirements
> >
> >
> > The first two step run with out a problem, but step 3 throws the
> > exception
> > seen below. Is it possible to do something like flush the entity
> > cache after
> > step 1 ?
> >
> >
> > ---- exception report
> > ----------------------------------------------------------
> > Service [updateJobLogEntry] threw an unexpected exception/error
> > Exception: org.ofbiz.service.GenericServiceException
> > Message: Service target threw an unexpected exception (This object
> > has been
> > flagged as immutable (unchangeable), probably because it came from
> > an Entity
> > Engine cache. Cannot set a value in an immutable entity object.)
> > ---- stack trace
> > ---------------------------------------------------------------
> >
> >
> > Kinds regard
> >
> > Grant e
>
>