Solved by changing transaction isolation from REPEATABLE-READ to READ COMMITTED on the database level by using
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
which can also be done in persistence.xml by adding line:
<property name="hibernate.connection.isolation">2</property>
Where isolation parameter can be:
1: READ UNCOMMITTED
2: READ COMMITTED
4: REPEATABLE READ
8: SERIALIZABLE