From users-return-10319-apmail-openjpa-users-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 24 17:22:43 2012 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 5265EDEF8 for ; Mon, 24 Sep 2012 17:22:43 +0000 (UTC) Received: (qmail 92777 invoked by uid 500); 24 Sep 2012 17:22:43 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 92735 invoked by uid 500); 24 Sep 2012 17:22:43 -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 92726 invoked by uid 99); 24 Sep 2012 17:22:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Sep 2012 17:22:43 +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 (nike.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; Mon, 24 Sep 2012 17:22:36 +0000 Received: from jim.nabble.com ([192.168.236.80]) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TGCMJ-0000NW-Fo for users@openjpa.apache.org; Mon, 24 Sep 2012 10:22:15 -0700 Date: Mon, 24 Sep 2012 10:22:15 -0700 (PDT) From: garpinc To: users@openjpa.apache.org Message-ID: <1348507335479-7581193.post@n2.nabble.com> In-Reply-To: References: <1345667358281-7580917.post@n2.nabble.com> <1348170464744-7581155.post@n2.nabble.com> <1348498874829-7581188.post@n2.nabble.com> Subject: Re: Duplicate entry issue with multithreaded application MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The problem occurs because the process is running in parallel (with unique entity managers per thread) for performance reasons and may encounter the same row because of interrelated data. The reason i'm marking the fields as dirty is because the jpa object is a wrapper around another object which contains the actual data. When that wrappee is assigned then in order for the wrapper to know that the fields have to be marked dirty Where can you catch the PersistenceException? The exception occurs in the commit where many interactions with the database are occurring. I don't want to catch the exception around the commit. I want to catch it around the individual statement. -- View this message in context: http://openjpa.208410.n2.nabble.com/Duplicate-entry-issue-with-multithreaded-application-tp7580917p7581193.html Sent from the OpenJPA Users mailing list archive at Nabble.com.