getEntityManager().merge(entity); will result in an error in a cluster environment, because the update statement is going with {upsert: true }
. With sharded collections need to specify whole shard key in order to update a record. It isn't enough to specify only primary key. I'm not sure, perhaps you already have an option for this situation, but with lack of documentation I wasn't be able to find it. May be need to create a new annotation to define a shard key for the entity, or make a parameter for the persistence context to disable upsert:true... Need to do something...
|