Error: Autocommit objects detected

0
Hello, I am running the scheduler event in production server which in turn calls the microflow to update certain objects. The scheduler event is working as expected but at the end of the microflow call, I get this error.    2023-08-31T00:11:37.487556 [APP/PROC/WEB/0]  Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: Autocommitted objects detected at end of transaction for system session for entities:  2023-08-31T00:11:37.487588 [APP/PROC/WEB/0]   - Dm_ProjectCode.LOCATION_PROJECT_CODE: 1459 instances   Can anyone tell me what can be the reason? Is this error mean that I need to commit only the parent entity and I must not commit its associated entities explicitly? 
asked
2 answers
1

Heey Raghavendra,

 

Autocommitted objects means that the system commits more then what you commit in the microflow. The system does this to keep the domain model in sync. This is something that you want to prevent. Have a look at this link where mendix explains more about autocommited objects. https://docs.mendix.com/refguide/committing-objects/#autocommit-and-associated-objects

 

Kind regards,

Edo

answered
1

Hai  Raghavendra Bhagwat,

  In your case please make sure whether you are committing main object which is used as reference  for another object. Because if you are referencing one object to another that object should be present in DB. So that Mendix Runtime do the commit automatically and throw this error, if you didn’t commit it. 

Please refer this Mendix docs to get clearance 
https://docs.mendix.com/refguide/mobile/building-efficient-mobile-apps/offlinefirst-data/auto-committed-objects/#:~:text=Auto%2Dcommitted%20objects%20are%20Mendix,of%20Commit%20Object(s)

answered