Simultaneous Authentication Attempts by A User Throws ConstraintViolationException
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Simultaneous authentication attempts by a user throws ConstraintViolationException:
1
2
3
4
5
6
7
8
9
10
11
12
2011-03-04 22:13:16,639 http-127.0.0.1-8096-9 ERROR [hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
:
:
Caused by: java.sql.BatchUpdateException: Duplicate entry 'V1h2OoiudimnxhnRbgPLNA00' for key 2
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2020)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1451)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 118 more
Cause
See CWD-998 - Simultaneous authentication attempts by same user throws ConstraintViolationException.
Typically happens when users tried to login twice (eg. they experienced some sorts of slow login, thus they tried to login again).
Work Around
Store session in Memory: Session configuration.
Was this helpful?