Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C6057A9A for ; Tue, 15 Nov 2011 16:08:05 +0000 (UTC) Received: (qmail 30052 invoked by uid 500); 15 Nov 2011 16:08:04 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 30014 invoked by uid 500); 15 Nov 2011 16:08:04 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 30006 invoked by uid 99); 15 Nov 2011 16:08:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2011 16:08:04 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2011 16:07:58 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RQLXr-0004Fk-NF for users@camel.apache.org; Tue, 15 Nov 2011 08:07:35 -0800 Date: Tue, 15 Nov 2011 08:07:35 -0800 (PST) From: bvahdat To: users@camel.apache.org Message-ID: <1321373255714-4994753.post@n5.nabble.com> In-Reply-To: References: <4EB3B700.2050301@die-schneider.net> <1320430916315-4964858.post@n5.nabble.com> <1321103009298-4986867.post@n5.nabble.com> Subject: Re: Misleading jmx statistics on jpa component MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit @Claus, That's for sure may be not correct, but it's how I see it: To my understanding in the sense of the CRUD operation one can C, U or D an entity through the JpaProducer, however only R through a JpaConsumer, so don't get the point why JpaConsumer should do entityManager.flush() at all, for example while polling! Other than that I don't think that calling entityManager.flush() could help in any way in the case the JPA-Provider throws PersistenceException in JpaConsumer.poll() and that gets just swallowed & flush() gets called afterwards. To me that PersistenceException would mean that some serious problems on the DB occured while reading through a JPA or Native Query on the JpaConsumer from which we could ever/never recover ourself: PersistenceException cause = null; int messagePolled = 0; try { messagePolled = processBatch(CastUtils.cast(answer)); } catch (Exception e) { if (e instanceof PersistenceException) { cause = (PersistenceException) e; } else { cause = new PersistenceException(e); } } if (cause != null) { if (!isTransacted()) { LOG.warn("Error processing last message due: {}. Will commit all previous successful processed message, and ignore this last failure.", cause.getMessage(), cause); entityManager.flush(); } else { // rollback all by throwning exception throw cause; } } In the sense of the expected ACID properties I think having that consumer.transacted default to false would violate the A (all or nothing). Maybe true would be better. Again that's just my 2 cents which may be not correct at all. Thanks, Babak -- View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4994753.html Sent from the Camel - Users mailing list archive at Nabble.com.