isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andi Huber <ahu...@apache.org>
Subject Re: Expected multiple ObjectUpdatedEvents but only 1 catched
Date Wed, 09 May 2018 17:15:47 GMT
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 <e.dehair@pocos.nl> 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<Entity>{ }
> 
>      @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<Entity> entities = <query result>;
> 
>          for (Entity entity : entities) {
>              entity.activate();
>          }
>      }
> }
> 
> Thanks,
> Erik
> 
> 
> 

Mime
View raw message