Syncing up two JPAContainers

I have two Instances of JPA Containers that should contain the same data but with possibly different filters applied to them. Is there a way to make it so that both JPA Containers are linked to the same data source?

Thanks,
-Ryan

It seem to be possible.

For example in the JPAContainer’s Addressbook demo (https://github.com/vaadin/jpacontainer/tree/master/jpacontainer-addressbook-demo), you can create two identical JPAContainer which could be filtered separately and are synchronized after you add a new entity trough e.g. person1 container and search it from person2 container

persons1 = JPAContainerFactory.make(Person.class,
                JpaAddressbookUI.PERSISTENCE_UNIT);
persons2 = JPAContainerFactory.make(Person.class,
                JpaAddressbookUI.PERSISTENCE_UNIT);

that doesn’t seem to work without refreshing the containers which takes forever. Is there a way to do it without refreshing?

It does not seem that there is any easy way to do that, it might be possible by notifying the second JPAContainer for changes in the other. But I think that will require overriding some methods of JPAContainer class.