From derby-user-return-11910-apmail-db-derby-user-archive=db.apache.org@db.apache.org Thu Nov 19 17:26:28 2009 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 53502 invoked from network); 19 Nov 2009 17:26:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Nov 2009 17:26:19 -0000 Received: (qmail 72595 invoked by uid 500); 19 Nov 2009 17:26:08 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 71762 invoked by uid 500); 19 Nov 2009 17:26:06 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 71190 invoked by uid 99); 19 Nov 2009 17:25:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Nov 2009 17:25:47 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [89.31.137.30] (HELO smtp02.udag.de) (89.31.137.30) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Nov 2009 17:25:44 +0000 Received: from alabama (p509966fb.dip0.t-ipconnect.de [80.153.102.251]) by smtp02.udag.de (Postfix) with ESMTP id 7AD65F05AB for ; Thu, 19 Nov 2009 18:35:43 +0100 (CET) Reply-To: From: "Josef Duschl" To: Subject: Performance Problems: Derby & Hibernate - Update of many entries in a table with foreign key constraints Date: Thu, 19 Nov 2009 18:25:25 +0100 Organization: CreamTeam GmbH Message-ID: <000201ca693d$4813d020$d83b7060$@de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcppPUfHpTwEjnbCQ0CQSC0l/uZNSA== Content-Language: de Hi there, I'm using Derby and Hibernate (coupled to EMF & Teneo) in an Eclipse rich client application. The Derby version is 10.5.3.0, the Hibernate tools version is 3.2.4.GA-R200905070146-H18. My application implements a synchronization mechanism, which pulls Objects off a Webservice. There are master data objects which need to be completely synchronized every time because there are no version or change information available. This results in a lot of updated rows in the tables. Upon saving the Hibernate EMF resource, the program grinds to a halt in the following place: Thread [ModalContext] (Suspended) UpdateResultSet.foundRow(ExecRow, int[], TemporaryRowHolderImpl) line: 1013 UpdateResultSet.runChecker(boolean) line: 975 UpdateResultSet.open() line: 264 GenericPreparedStatement.executeStmt(Activation, boolean, long) line: 416 GenericPreparedStatement.execute(Activation, long) line: 297 EmbedPreparedStatement30(EmbedStatement).executeStatement(Activation, boolean, boolean) line: 1235 EmbedPreparedStatement30(EmbedPreparedStatement).executeStatement(Activation , boolean, boolean) line: 1675 EmbedPreparedStatement30(EmbedPreparedStatement).executeUpdate() line: 302 NonBatchingBatcher.addToBatch(Expectation) line: 23 OneToManyPersister(AbstractCollectionPersister).remove(Serializable, SessionImplementor) line: 1048 CollectionUpdateAction.execute() line: 41 ActionQueue.execute(Executable) line: 250 ActionQueue.executeActions(List) line: 234 ActionQueue.executeActions() line: 144 DefaultFlushEventListener(AbstractFlushingEventListener).performExecutions(E ventSource) line: 298 DefaultFlushEventListener.onFlush(FlushEvent) line: 27 SessionImpl.flush() line: 1000 HbSessionWrapper.flush() line: 171 HibernateResource.saveResource(Map) line: 375 HibernateResource(StoreResource).save(Map) line: 430 SynchronizationWizard$1.run(IProgressMonitor) line: ModalContext$ModalContextThread.run() line: 121 There are two nested while loos in runChecker and foundRow which iterate over the same data. One call of foundRow takes about 3 seconds. The result sets contain >2000 elements as far as I can see. Is there any way to disable these checks or to make them faster (ie utilize the index on the primary key of the table)? Kind Regards, Josef