openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: openjpa.RetainState
Date Fri, 28 Sep 2012 15:27:06 GMT
> My question is if the statement of turning of the EntityManager cache
is correct and if so, why doesn't the manual inform about this effect?
No openjpa.RetainState doesn't disable the EntityManager L1 cache. When
disabled, persistent fields will not retain values on transaction commit.
So on tran commit, Entity identities still exist in the L1 cache, but no
persistent values are retained.

If you're having data integrity issues, I don't think that changing the
setting of this flag is the correct answer for your problems. You should
use optimistic locking to ensure that you only put the most up to date data
into your database.

Hope this helps.

Rick

http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#openjpa.RetainState

On Fri, Sep 28, 2012 at 12:26 AM, Daniel Persson <mailto.woden@gmail.com>wrote:

> Hi.
>
> We're looking into solving an read write problem we see in consistency with
> the database. Our application is written depending on the database always
> having the right values at all times. We have run openjpa for a while now
> and had some consistency problems but we workes around them.
>
> Now a colleague of mine found that changing the RetainState to false
> actually turns off the EntityManager cache. We use the data and query cache
> so it should not impact operations.
>
> My question is if the statement of turning of the EntityManager cache is
> correct and if so, why doesn't the manual inforn about this effect?
>
> Best regards
> Daniel Persson
>



-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message