- void setPrimaryShard(ActorSelection primaryShard, short primaryVersion) {
- this.primaryShard = primaryShard;
+ void setPrimaryShard(PrimaryShardInfo primaryShardInfo) {
+ this.primaryShardInfo = primaryShardInfo;
+
+ if (getTransactionType() == TransactionType.WRITE_ONLY
+ && getActorContext().getDatastoreContext().isWriteOnlyTransactionOptimizationsEnabled()) {
+ ActorSelection primaryShard = primaryShardInfo.getPrimaryShardActor();