TITLE: When do flat holomorphic connections exist?
QUESTION [10 upvotes]: Let $X$ be a smooth projective variety over $\mathbb{C}$.
I know that a vector bundle $\mathcal{E}$ on $X$ admits a holomorphic/algebraic connection iff its Atiyah class vanishes, $A(\mathcal{E}) = 0$. If we choose a Hermitian structure on $\mathcal{E}$ giving a Chern connection $\nabla$ then $A(\mathcal{E}) = [\omega_\nabla]$ where $\omega_\nabla$ is the curvature. Therefore, if $\mathcal{E}$ admits a flat Hermitian structure then it admits a holomorphic connection.
I am wondering to what extent this has a converse. Precisely, there are four properties I am interested in:
(1) $\mathcal{E}$ admits a flat connection,
(2) $\mathcal{E}$ admits a flat Hermitian structure,
(3) $\mathcal{E}$ admits a holomorphic connection,
(4) $\mathcal{E}$ admits a flat holomorphic connection.
What are the implications between these properties? We know (2) $\implies (3)$ and obviously (4) $\implies$ (3) and (2) $\implies$ (1) and (4) $\implies$ (1). What about (1) $\implies$ (2) and (3) $\implies$ (4)?
If $\mathcal{E}$ admits a holomorphic connection then we know that $[\omega_\nabla] = 0$ for any Chern connection but I cannot see how to conclude that there exists a flat Chern connection.
I know from How many flat connections has a line bundle in algebraic geometry? that if $\mathcal{E}$ is a line bundle then any holomorphic connection is automatically flat, but it is clear that this is false for rank at least two.
Explicit counterexamples would be helpful.

REPLY [9 votes]: The comment of HYL should be an answer. Since the OP has asked for explicit counterexamples, I will give an example  that 1) does not imply 2):
Consider a compact Riemann surface $\Sigma$ of genus $g\geq 2.$ A complex projective structure on $\Sigma$ is given by an atlas of holomorphic coordinates which are related to each other by Moebius transformations (as given by  $PSL(2,\mathbb C)$). The developing map $\widetilde\Sigma\to\mathbb CP^1$ is well-defined on the universal covering and induces a $PSL(2,\mathbb C)$ monodromy.
It is well-known that (for compact Riemann surfaces) there always exists a lift to a $SL(2,\mathbb C)$ monodromy.
The corresponding flat $SL(2,\mathbb C)$-bundle $(V\to\Sigma,\nabla)$ induced from the representation is unstable. In fact, the projective structure can be recovered from $\nabla$ as follows. There is a holomorphic subbundle $S\to V$ such that
$$\nabla \colon S\to K_\Sigma V/S$$ is an isomorphism. As $V/S=S$ this implies that $S^2=K_\Sigma.$ Thus, the holomorphic bundle $V$ is unstable. On the other hand, every flat Hermitian bundle must be semi-stable (stable or totally reducible).