openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Baylis <maill...@baylishome.me.uk>
Subject OpenJPA 2.1.1 and read entitys being marked as dirty
Date Tue, 17 Jan 2012 15:12:23 GMT
Hi Folks,
         I am experiencing an oddity that I can't google my way out of.

I am running OpenJPA 2.1.1 under Tomcat 7.0.23 by using my own 
EntityManager object that I create when the application starts.

What I am noticing is when I update a field in an entity and then commit 
the transaction,  all entities that I have read so far appear to be 
dirty and is updated in the backend database, even though I have not 
updated them.

I have performed further testing by amending a query to be surrounded by 
a begin() and commit() and the commit causes the db records to be 
updated even though I know that no updates have taken place.

I am obviously missing something in the setup that causes this, but I am 
at a loss to what.

If I run a similar query outside of a Tomcat servlet, ie in native Java, 
I don't seem to encounter this problem.

Any help in diagnosing this would be appreciated.

Cheers,

Michael

Mime
View raw message