I am reading about "Fraction on Commutative Ring". On the textbook a proposition states that
Let $R$ be a domain and $a,b\in R$. If $a\mid b$ and $b\mid a$, then there exists a unit $u$ such that $a=bu$.
And I am wondering if there exists a counterexample if $R$ is a commutative ring but not a domain. The textbook did not provide one. I tried finding it on a matrix ring and its subrings, but I did not find one. And I searched the problem on MSE, but did not find a relating question.