Hello all,
I am implementing a custom provider with jdbc connection. When i am trying to assign roles to a user for the first time, i am getting the following error. The second time that i am trying to assign the same roles, everything seems to work properly.
2024-08-06 14:43:38,236 WARN [com.arjuna.ats.arjuna] (executor-thread-4) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffac11000a:96a5:66b23603:178, org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization@4c709bbf >: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1411)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:489)
at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3303)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2438)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:449)
at org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.beforeCompletion(JtaTransactionCoordinatorImpl.java:356)
at org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorNonTrackingImpl.beforeCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:47)
at org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:37)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:360)
I have seen that in the comments of the UserStorageProvider class, the UserBulkUpdateProvider, ImportedUserValidation, ImportSynchronization should be implemented. I am trying to find an example of implementation of those, but for now no luck.
Could you please advise if it is mandatory to implement the extra interfaces due to the error i am getting? Is there a complete example on how it is supposed to be implemented because from the documentation it is not clear to me how it is supposed to be implemented.
Thank you in advanced