  Migration commonly occurs during the epoch of planet formation. For emerging
gas giant planets, it proceeds concurrently with their growth through the
accretion of gas from their natal protoplanetary disks. Similar migration
process should also be applied to the stellar-mass black holes embedded in
active galactic nucleus disks. In this work, we perform high resolution 3D and
2D numerical hydrodynamical simulations to study the migration dynamics for
accreting embedded objects over the disk viscous timescales in a
self-consistent manner. We find that an accreting planet embedded in a
predominantly viscous disk has a tendency to migrate outward, in contrast to
the inward orbital decay of non-accreting planets. 3D and 2D simulations find
the consistent outward migration results for the accreting planets. Under this
circumstance, the accreting planet's outward migration is mainly due to the
asymmetric spiral arms feeding from the global disk into the Hill radius. This
is analogous to the unsaturated corotation torque although the imbalance is due
to material accretion within the libration timescale rather than diffusion onto
the inner disk. In a disk with a relatively small viscosity, the accreting
planets clear deep gaps near their orbits. The tendency of inward migration is
recovered, albeit with suppressed rates. By performing a parameter survey with
a range of disks' viscosity, we find that the transition from outward to inward
migration occurs with the effective viscous efficiency factor $\alpha\sim
0.003$ for Jupiter-mass planets.
