{"id":761,"date":"2020-01-08T20:27:14","date_gmt":"2020-01-08T20:27:14","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/performance\/microflows-should-commit-at-the-end\/"},"modified":"2020-07-08T14:35:30","modified_gmt":"2020-07-08T14:35:30","slug":"commitatend","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/commitatend","title":{"rendered":"Microflows should perform database actions at the end"},"content":{"rendered":"\n<p style=\"text-align:center\">Introduced in version: 1.3 (29 Jan 2020)<\/p>\n\n\n\n<p>To make sure records in the database are locked as briefly as possible all database actions should be done at the end of the microflow. After a database action, there should be no long-running actions, e.g. rest calls. These can potentially lock the records for a long time.<br>See this blog post for more information &#8211;  <a href=\"https:\/\/blog.mansystems.com\/mendix\/top-10-performance-improvement-tips-for-mendix\">https:\/\/blog.mansystems.com\/mendix\/top-10-performance-improvement-tips-for-mendix<\/a> <\/p>\n\n\n\n<p><strong>Noncompliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"454\" height=\"125\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-60.png\" alt=\"\" class=\"wp-image-1005\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-60.png 454w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-60-300x83.png 300w\" sizes=\"(max-width: 454px) 100vw, 454px\" \/><\/figure>\n\n\n\n<p><strong>Compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"236\" height=\"141\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-59.png\" alt=\"\" class=\"wp-image-1004\"\/><\/figure>\n\n\n\n<p>Configuration of what action are not allowed after a commit:<\/p>\n\n\n\n<p>\n\n[\n{&#8220;Action&#8221;:&#8221;AppServiceCallAction&#8221;},\n{&#8220;Action&#8221;:&#8221;DownloadFileAction&#8221;},\n{&#8220;Action&#8221;:&#8221;JavaActionCallAction&#8221;},\n{&#8220;Action&#8221;:&#8221;RetrieveAction&#8221;,\n&#8220;Database&#8221;: true},\n{&#8220;Action&#8221;:&#8221;RestCallAction&#8221;},\n{&#8220;Action&#8221;:&#8221;GenerateDocumentAction&#8221;},\n{&#8220;Action&#8221;:&#8221;ExportXmlAction&#8221;}\n{&#8220;Action&#8221;:,&#8221;ImportXmlAction&#8221;}\n]\n\n<\/p>\n\n\n\n<p>Leaving the configuration empty takes this default.<\/p>\n","protected":false},"featured_media":0,"parent":95,"menu_order":19,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-761","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/761"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=761"}],"version-history":[{"count":7,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/761\/revisions"}],"predecessor-version":[{"id":1458,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/761\/revisions\/1458"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/95"}],"next":[{"title":"Not\/or expressions in XPath should be avoided when the path goes over an association","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/notorxpath","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1221"}],"prev":[{"title":"Microflow should not apply entity access","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/microflowentityaccess","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/529"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=761"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}