Skip to content
Snippets Groups Projects
Commit 327fa05e authored by Mário Murín's avatar Mário Murín
Browse files

Fix incorrect data fetching

parent 6f8a9d8b
No related branches found
No related tags found
2 merge requests!142Develop,!138Resolve "Duplicate userRefId causing lockup on a parallel upload"
Pipeline #483850 passed with stages
in 3 minutes and 15 seconds
......@@ -25,7 +25,7 @@ public class UserRefRepositoryImpl implements UserRefRepositoryCustom {
"ON CONFLICT DO NOTHING")
.setParameter("userRefId", userRefId)
.executeUpdate();
if (rowsAffected != 0) {
LOG.info("User with user_ref_id {} created", userRefId);
}
......@@ -33,7 +33,7 @@ public class UserRefRepositoryImpl implements UserRefRepositoryCustom {
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<User> criteriaQuery = criteriaBuilder.createQuery(User.class);
Root<User> root = criteriaQuery.from(User.class);
criteriaBuilder.and(criteriaBuilder.equal(root.get("userRefId"), userRefId));
criteriaQuery.select(root).where(criteriaBuilder.equal(root.get("userRefId"), userRefId));
return entityManager.createQuery(criteriaQuery).getSingleResult();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment