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 9FAD5105B5 for ; Thu, 12 Dec 2013 04:43:10 +0000 (UTC) Received: (qmail 84293 invoked by uid 500); 12 Dec 2013 04:42:15 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 84199 invoked by uid 500); 12 Dec 2013 04:41:57 -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 84127 invoked by uid 99); 12 Dec 2013 04:41:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Dec 2013 04:41:47 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of richie.riviere@gmail.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Dec 2013 04:41:42 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Vqy5R-0001Uk-9r for users@camel.apache.org; Wed, 11 Dec 2013 20:41:21 -0800 Date: Wed, 11 Dec 2013 20:41:21 -0800 (PST) From: "richie.riviere@gmail.com" To: users@camel.apache.org Message-ID: <1386823281279-5744651.post@n5.nabble.com> In-Reply-To: <1386821487734-5744650.post@n5.nabble.com> References: <1386799515938-5744640.post@n5.nabble.com> <1386818727536-5744646.post@n5.nabble.com> <1386821487734-5744650.post@n5.nabble.com> Subject: Re: JPA @Consumed MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Abother question about @Consumed. Using the strategy as described in my last post, what I am doing in selecting an ImportPayloadEntity, splitting this entity which has a list of ItemEntities into individual ItemEntity objects and processing each ItemEntity object. During the processing of each ItemEntity object I call... item.setWorkingProcessedInd("Y"); item.setWorkingProcessedDatetime(new Date()); Then once the route is finish in the ImportPayloadEntity bean I do something like this... @Consumed public void markConsumed() { boolean errors = false; Collection itemEntities = this.getItems(); for (ItemEntity itemEntity: itemEntities){ if (itemEntity.getProcessedInd().equals(DaoConstants.ERROR)){ errors = true; } itemEntity.setProcessedInd(itemEntity.getWorkingProcessedInd()); itemEntity.setProcessedDatetime(itemEntity.getWorkingProcessedDatetime()); } this.setProcessedInd(errors ? DaoConstants.ERROR : DaoConstants.PROCESSED); this.setProcessedDatetime(new Date()); } This leads to the ImportPayloadEntity record in the db being updated. But where this strategy fails is that when i do... itemEntity.setProcessedInd(itemEntity.getWorkingProcessedInd()); itemEntity.setProcessedDatetime(itemEntity.getWorkingProcessedDatetime()); itemEntity.getWorkingProcessedInd() and itemEntity.getWorkingProcessedDatetime() are both null. In other words it has not remembered the values I set on the objects in my route. It seems somewhere along the line my ItemEntity objects are not being passed by reference. Am I right? What would be a good way to fix this? thanks -- View this message in context: http://camel.465427.n5.nabble.com/JPA-Consumed-tp5744640p5744651.html Sent from the Camel - Users mailing list archive at Nabble.com.