CoreRuntimeException: Failed to commit - UpdateConflictException

0
  Im debugging an application and i keep seeing the below error in the stacktrace. There are no before or after commit flows on the object.\ The error seems to happen when I do the commit in a change action. Does anybody know how I can fix this issue?   com.mendix.modules.microflowengine.MicroflowException: Failed to commit at AApp_Offer.OCH_ValidateContractDuration (Change : 'Change 'Offer' (_MinimumContractDurationInMonths, _ProductExeedsMinimumContractDuration)') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:83) Caused by: com.mendix.core.CoreRuntimeException: Failed to commit at com.mendix.basis.component.TransactionCore.commit(TransactionCore.scala:149) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.datastorage.exception.UpdateConflictException at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:109) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.datastorage.exception.UpdateConflictException at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:23) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.datastorage.exception.UpdateConflictException at com.mendix.basis.actionmanagement.SyncEventExtendedAction.executeAction(SyncEventExtendedAction.scala:32) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.datastorage.exception.UpdateConflictException at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:109) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.datastorage.exception.UpdateConflictException at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:23) Caused by: com.mendix.datastorage.exception.UpdateConflictException: null at com.mendix.connectionbus.connections.jdbc.JdbcDataStore.withPreparedStatement(JdbcDataStore.scala:1079) at com.mendix.connectionbus.connections.jdbc.JdbcDataStore.$anonfun$execModificationQueries$1(JdbcDataStore.scala:815) at com.mendix.connectionbus.connections.jdbc.JdbcDataStore.$anonfun$execModificationQueries$1$adapted(JdbcDataStore.scala:815) at com.mendix.connectionbus.connections.jdbc.JdbcDataStore.$anonfun$executeWithUcViolationHandling$1(JdbcDataStore.scala:991) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.util.Try$.apply(Try.scala:210)  
asked
6 answers
1

Are you committing the parent object before the children?

answered
0

The only other place this exception is mentioned on the forum is here:  

https://forum.mendix.com/link/space/microflows/questions/10488

 

In his comment Ronald Catersels suggests the issue from that thread was fixed in Mendix Studio Pro 8.12.

answered
0

The exception description states: 

Thrown when a snapshot transaction attempts to update data which was modified after the snapshot transaction read it.

 

Did you check if the microflow is triggered twice? Or that another process is changed the values at the same time?

 

answered
0

It looks like an instance of an object is committed with different data by different users, but I'm not too sure about this either. Maybe you can reproduce it locally by attempting to update a certain object in two different microflows with two different sessions? I'd create 2 accounts, open both in an incognito window/after clearing cookies so you'll have 2 different sessions, press the button for both sessions and see what happens. Remember to include a delay so you are sure that both run at the same time (and share the answers, I'm curious). 

answered
0

Hi Kevin,

 

I’m not sure about my answer, but it is worth checking it:

 

This part of the error: Caused by: com.mendix.datastorage.exception.UpdateConflictException: null at com.mendix.connectionbus.connections.jdbc.JdbcDataStore.withPreparedStatement(JdbcDataStore.scala:1079) triggered me to think that maybe on an attribute of your Object that you want to commit, you have an Event Handler. (Before or After Commit). If the Attribute has value null (empty), this could be a reason for an exception. 

 

Go Make It

answered
0

Hi Kevin,

Iam facing a similar kind of issue in mendix 8.18.19 for all the microflows which were executed concurrently. Do you have any idea how to fix this ?

Failed to commit :

com.mendix.modules.microflowengine.MicroflowException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.datastorage.exception.UpdateConflictException.

Please let me know if you have any inputs

 

answered