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 8A9D393DB for ; Tue, 17 Jan 2012 19:03:49 +0000 (UTC) Received: (qmail 87879 invoked by uid 500); 17 Jan 2012 19:03:49 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 87741 invoked by uid 500); 17 Jan 2012 19:03:48 -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 87733 invoked by uid 99); 17 Jan 2012 19:03:48 -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 19:03:48 +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.17.10] (HELO moutng.kundenserver.de) (212.227.17.10) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2012 19:03:41 +0000 Received: from r820dfv.hursley.ibm.com (host86-133-109-147.range86-133.btcentralplus.com [86.133.109.147]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0M1ygd-1SgIuK1bTv-00txTL; Tue, 17 Jan 2012 20:03:19 +0100 Message-ID: <4F15C5F5.4040507@baylishome.me.uk> Date: Tue, 17 Jan 2012 19:03:17 +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: Re: OpenJPA 2.1.1 and read entitys being marked as dirty References: <4F158FD7.2080203@baylishome.me.uk> <4F159221.30104@baylishome.me.uk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:W5bRjt1r2J985xFL2oRNnT8dPemxQ7MipLtUoCiZToP BIbx1UO94CubwJt3aI3rixnANM4sOThq4mPjQLvtg+qDPSdvst O/KlcHj0YfxaHR69/cgd95T03XUNo/gLDgxKuv5JoQ4KjhsSDs N6EyAVMG82g6gK/3NaaHu1gm2G2MXtANLh+7ZZ8yY0tpiRgrTg 8HhH1TZXJF341J900/iW3++/E/oB5l7tLyKQ+jJCI+2eTy1aSA hhzXMf8vgw0z6pxNr9H8WcB2fcW3pvliHRbGXc8NKO6veJasky 2F3R78wdjZCIN3OL+3NTrGYZ/GmjK9PmTe1uZy29mNVkWDmadG Wll4We1Yns0Q5GX6ts+yr4u742rVSn92y4pkStFmpOZT1MZdH1 vzuHj5EJvUAhg== Ok, switched to buildtime enhancement and getting different problems now!! Switched to working with a basic java project to resolve all the problems..... When attempting to use :- Account account = em.find(Account.class, "JL"); I get:- Exception in thread "main" org.apache.openjpa.persistence.EntityNotFoundException: Cannot perform find using null object id. FailedObject: null [java.lang.String] at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:920) at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:902) at org.apache.openjpa.kernel.DelegatingBroker.find(DelegatingBroker.java:231) at org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:486) I have googled and found references by no solutions, tried to step into the code bt I get lost along the way!! The key is a simple string and does exist in the DB. I do, however, notice this message:- 12263 [main] INFO openjpa.Runtime - The Entity "uk.me.baylishome.homeaccounts.jpa.Account" was enhanced at level "2", but the current level of enhancement is "1,055,128". which doesn't sound right. Only OpenJPA 2.1.1 is on the classpath, and build path, so I don't understand the version match, any ideas? Getting very frustrated with this :-( Cheers, Michael On 01/17/2012 03:29 PM, Rick Curtis wrote: > Michael - > > I'm nearly certain that is your problem. I'd recommend getting build time > enhancement[1] working. > > [1] http://openjpa.apache.org/entity-enhancement.html > > Thanks, > Rick > > On Tue, Jan 17, 2012 at 9:22 AM, Michael Baylis > wrote: > >> Rick, >> As I am developing I am relying on runtime enhancement, however I >> have to have >> >> >> set. >> >> Cheers, >> >> Michael >> >> >> >> On 01/17/2012 03:20 PM, Rick Curtis wrote: >> >>> Michael - >>> >>> How are you enhancing your Entities? >>> >>> 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. >>> What fields are being updated? All of them? Are you running with SQL trace >>> enabled? >>> >>> On Tue, Jan 17, 2012 at 9:12 AM, Michael Baylis >>> **wrote: >>> >>> 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 >>>> >>>> >>> >