Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1A4DC95CB for ; Tue, 17 Jan 2012 15:12:55 +0000 (UTC) Received: (qmail 41443 invoked by uid 500); 17 Jan 2012 15:12:54 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 41364 invoked by uid 500); 17 Jan 2012 15:12:54 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 41355 invoked by uid 99); 17 Jan 2012 15:12:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2012 15:12:54 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [212.227.126.171] (HELO moutng.kundenserver.de) (212.227.126.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2012 15:12:46 +0000 Received: from r820dfv.hursley.ibm.com (host86-133-109-147.range86-133.btcentralplus.com [86.133.109.147]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0LwVKN-1Sji1120nn-017x5u; Tue, 17 Jan 2012 16:12:24 +0100 Message-ID: <4F158FD7.2080203@baylishome.me.uk> Date: Tue, 17 Jan 2012 15:12:23 +0000 From: Michael Baylis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: users@openjpa.apache.org Subject: OpenJPA 2.1.1 and read entitys being marked as dirty Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:bw5uqVjmadl+G8WlxY9SjrHQDlH8GPxGAzwXjfg+Xs6 y5uigEZNCzFjilLPwwIx01JG6jVeMvQ+1pIKPQXcjkvOk6pACr wx5KHfph6vKPEohhD8qkBGB4VtumKLd+fHvdh/ZCcOqADqRRwF tMR+zC7l8hqnim4G0F+luUfEKysMnaa109IZwrFGvPhPONlOt4 ijvNAFrSvbRGC6wb5lYsryDTLQZMxLH6fLPWUjnvYDxZjAKEOk SU5sHYUSqZk6v2mTymVGTbXezBmhdbpVLdd6czZEw3RdohypKC CgbyqWXjljuzw6alQWeFgmCg0D71EOPzAV85vizsvadcGGQlP3 BRFUybiOIcm4jmDhk5R1ai1s0yCj/D2meSAey1OYM8UZR99kTK uz+a/y4FE9/NQ== 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