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 3A3CBD485 for ; Wed, 19 Sep 2012 19:56:58 +0000 (UTC) Received: (qmail 4178 invoked by uid 500); 19 Sep 2012 19:56:57 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 4063 invoked by uid 500); 19 Sep 2012 19:56:57 -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 4052 invoked by uid 99); 19 Sep 2012 19:56:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 19:56:56 +0000 X-ASF-Spam-Status: No, hits=3.0 required=5.0 tests=FORGED_YAHOO_RCVD,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 19:56:51 +0000 Received: from jim.nabble.com ([192.168.236.80]) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TEQNr-0000ry-ER for users@openjpa.apache.org; Wed, 19 Sep 2012 12:56:31 -0700 Date: Wed, 19 Sep 2012 12:56:31 -0700 (PDT) From: garpinc To: users@openjpa.apache.org Message-ID: <1348084591438-7581136.post@n2.nabble.com> In-Reply-To: <1347414269422-7581074.post@n2.nabble.com> References: <1344697964608-7580862.post@n2.nabble.com> <1347414269422-7581074.post@n2.nabble.com> Subject: Re: Can someone explain this OpenJPA trace? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org q.toString returns: SELECT a FROM AnzoURIToPKImpl a WHERE (a.uriHash = :param AND a.typeUriHash = :param) and this is correct... It turns out the statement SELECT t0.datasetUri, t0.datasetUriHash, t0.persistedFully, t0.typeUri, t0.typeUriHash, t0.uri, t0.uriHash FROM FILM.anzouritopk t0 WHERE t0.pk = ? [params=(long) 0] occurs when entityManager.persist(ObjectToPersist) is called.. where obj has a primary key of anzouritopk object where pk is not yet populated because it's a generated value. To illustrate ObjectToPersist(id=AnzouritopkInstance) AnzouritopkInstance(pk=null) here is mapping for AnzoURITOPK id column: @Id @Column(updatable = false) @GeneratedValue(strategy = GenerationType.AUTO) public Long getPk() { return pk; } Following the code path return persistInternal(obj, id, explicit, call, fireEvent); in BrokerImpl.java on line 2571 is called id == null at line 2639 meta.getIdentityType() is ClassMetaData.ID_APPLICATION at line 2651 id is now 0 bad select occurs on line 152 as below in stack trace. Here is stack trace FinderQueryImpl.execute(OpenJPAStateManager, StoreManager, FetchConfiguration) line: 152 JDBCStoreManager.getInitializeStateResult(OpenJPAStateManager, ClassMapping, JDBCFetchConfiguration, int) line: 537 JDBCStoreManager.initializeState(OpenJPAStateManager, PCState, JDBCFetchConfiguration, ConnectionInfo) line: 349 JDBCStoreManager.initialize(OpenJPAStateManager, PCState, FetchConfiguration, Object) line: 304 ROPStoreManager(DelegatingStoreManager).initialize(OpenJPAStateManager, PCState, FetchConfiguration, Object) line: 112 ROPStoreManager.initialize(OpenJPAStateManager, PCState, FetchConfiguration, Object) line: 57 FinalizingBrokerImpl(BrokerImpl).initialize(StateManagerImpl, boolean, FetchConfiguration, Object) line: 1036 FinalizingBrokerImpl(BrokerImpl).find(Object, FetchConfiguration, BitSet, Object, int, FindCallbacks) line: 994 FinalizingBrokerImpl(BrokerImpl).find(Object, FetchConfiguration, BitSet, Object, int) line: 916 FinalizingBrokerImpl(BrokerImpl).isDetached(Object, boolean) line: 4594 FinalizingBrokerImpl(BrokerImpl).isDetached(Object) line: 4563 SingleFieldManager.persist(OpCallbacks) line: 270 StateManagerImpl.cascadePersist(OpCallbacks) line: 3045 FinalizingBrokerImpl(BrokerImpl).persistInternal(Object, Object, boolean, OpCallbacks, boolean) line: 2670 FinalizingBrokerImpl(BrokerImpl).persist(Object, Object, boolean, OpCallbacks, boolean) line: 2571 FinalizingBrokerImpl(BrokerImpl).persist(Object, Object, boolean, OpCallbacks) line: 2554 FinalizingBrokerImpl(BrokerImpl).persist(Object, OpCallbacks) line: 2458 DelegatingBroker.persist(Object, OpCallbacks) line: 1077 EntityManagerImpl.persist(Object) line: 716 -- View this message in context: http://openjpa.208410.n2.nabble.com/Can-someone-explain-this-OpenJPA-trace-tp7580862p7581136.html Sent from the OpenJPA Users mailing list archive at Nabble.com.