[
https://issues.apache.org/jira/browse/SYNCOPE-973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15695668#comment-15695668
]
Francesco Chicchiriccò commented on SYNCOPE-973:
------------------------------------------------
After some experiments, it seems that the bug lies in
[UserDAOImpl#find|https://git-wip-us.apache.org/repos/asf?p=syncope.git;a=blob;f=core/src/main/java/org/apache/syncope/core/persistence/dao/impl/UserDAOImpl.java;hb=refs/heads/1_2_X#l64]
which is implemented with a JPQL query, instead of plain
{{entityManager#find}}.
According to the JPA specification, in fact, the former will *always* access
the underlying database while the latter will first look up into the JPA
context.
It seems that, under high load, the user just created in a given transaction
might not have been flushed yet to the database when another transaction
attempts to read it: hence, the JPQL query won't find it while
{{entityManager#find}} will do, instead.
N.B. This bug is not present in 2.0 and later versions, as
[shown|https://git-wip-us.apache.org/repos/asf?p=syncope.git;a=blob;f=core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java;hb=refs/heads/2_0_X#l117].
> NotFound error returned by user create under high load
> ------------------------------------------------------
>
> Key: SYNCOPE-973
> URL: https://issues.apache.org/jira/browse/SYNCOPE-973
> Project: Syncope
> Issue Type: Bug
> Components: core
> Affects Versions: 1.2.9
> Environment: MySQL
> Reporter: Francesco Chicchiriccò
> Assignee: Francesco Chicchiriccò
> Fix For: 1.2.10
>
>
> Under high load, it might happen that some user create requests randomly
> return NotFound (HTTP 404).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)