3. For the equation in $x$, $\left|\frac{x^{2}}{x-1}\right|=a$, there are only two distinct real roots. Then the range of the constant $a$ is ( ).
(A) $a>0$
(B) $a \geqslant 4$
(C) $2<a<4$
(D) $0<a<4$
3.D.

When $a>0$, the original equation becomes $\frac{x^{2}}{x-1}= \pm a$. Rearranging gives
$$
x^{2}-a x+a=0,
$$

or $x^{2}+a x-a=0$.
Since the discriminant of equation (2) is greater than 0, equation (2) has two distinct real roots.

Since the original equation has only two distinct real roots, the discriminant of equation (1) must be less than 0, thus, $0<a<4$.