From users-return-6014-archive-asf-public=cust-asf.ponee.io@isis.apache.org Wed May 9 19:15:50 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 130E7180649 for ; Wed, 9 May 2018 19:15:49 +0200 (CEST) Received: (qmail 45190 invoked by uid 500); 9 May 2018 17:15:49 -0000 Mailing-List: contact users-help@isis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@isis.apache.org Delivered-To: mailing list users@isis.apache.org Received: (qmail 45175 invoked by uid 99); 9 May 2018 17:15:48 -0000 Received: from ui-eu-01.ponee.io (HELO localhost) (176.9.59.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 May 2018 17:15:48 +0000 References: <2f1a2741-48d6-4b03-e524-12e0abc4afa3@pocos.nl> X-Mailer: LuaSocket 3.0-rc1 Date: Wed, 09 May 2018 17:15:47 -0000 Subject: Re: Expected multiple ObjectUpdatedEvents but only 1 catched To: x-ponymail-sender: c068aa2dca0e53ffba56f968adfd76454b89e063 In-Reply-To: <2f1a2741-48d6-4b03-e524-12e0abc4afa3@pocos.nl> Message-ID: From: Andi Huber x-ponymail-agent: PonyMail Composer/0.3 Content-Type: text/plain; charset=utf-8 MIME-Version: 1.0 Hi Erik, I managed to reproduce the issue, using your example code. I tested both axon and guava eventbus on the current master branch. I guess its reproducible with the latest release of 1.16. as well. Seems to be a bug with org.apache.isis.objectstore.jdo.datanucleus.service.eventbus.EventBusServiceJdo which skips event propagation, when it actually should not. (But I'm not really sure yet. Code seems to require some polishing, I guess.) Cheers, Andi On 2018/05/09 10:14:57, Erik de Hair wrote: > Hi, > > For the following scenario I expected an UpdatedEvent for each entity > being updated but I only receive one for the last updated entity. Is > that by design? > > Example classes: > > @PersistenceCapable(table = "entities") > @DomainObject(updatedLifecycleEvent = Entity.UpdatedEvent.class) > public class Entity { >     public static class UpdatedEvent extends > org.apache.isis.applib.services.eventbus.ObjectUpdatedEvent{ } > >     @Column(name = "activated", allowsNull = "false") >     @Getter @Setter >     private boolean activated; > >     public void activate(){ >         setActivated(true); >     } > } > > @DomainService(nature=NatureOfService.DOMAIN) > public class EntitySubscriber extends AbstractSubscriber { > >     @Subscribe >     public void on(Entity.UpdatedEvent ev) { >         // do something >     } > } > > @DomainService(nature = NatureOfService.DOMAIN) > public class EntityService { > >     public void activateAll(){ >         List entities = ; > >         for (Entity entity : entities) { >             entity.activate(); >         } >     } > } > > Thanks, > Erik > > >