Predicates created with different sessions cause generatedalias0 and generatedalias1

The solution was to set the same alias root.alias("myAlias"); at the two occasions where the predicate are generated that are supposed to be executed within the same query.