You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Grant Edwards <gr...@gmail.com> on 2008/02/07 21:04:25 UTC

Flushing the Entity Engine cache ?

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

Re: Flushing the Entity Engine cache ?

Posted by Grant Edwards <gr...@gmail.com>.
Thank you, just had another look at the code and was using
findByPrimaryCache

On Feb 7, 2008 10:20 PM, David E Jones <jo...@hotwaxmedia.com> 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
>
>

Re: Flushing the Entity Engine cache ?

Posted by David E Jones <jo...@hotwaxmedia.com>.
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