Simulate or implement @PostPersist

Hello team.

In JPA using the @PostPersist callback you could create a persist record in another entity with the information or data of the current entity without any problem. In CUBA I’m trying to do the same thing but I can not get the desired behavior, try it with AfterInsertEntityListener but simply the registry is not created

   EntityB e = metadata.create(EntityB.class);
   e.setProject(entity);
   e.setUser(entity.getUser());
   persistence.getEntityManager().persist(entity);

By leaving it inside a transaction generates a blockage of the entire system

try (Transaction tx = persistence.createTransaction()) {
   EntityB entity = metadata.create(EntityB.class);
   entity.setProject(entityA);
   entity.setUser(entityA.getUser());
   persistence.getEntityManager().persist(entity);
   tx.commit();
}

Ideas or suggestions equal the behavior of @PostPersist

Regards,
Nelson F

No suggestion about it?