for Transaction

0
hi readers Oops!! have to use "commit" every time?? after make CRUD activity. Can't make several and commit at once? How can make a program with Mendix without just like function? not easy to use....It's uncomfortable...
asked
3 answers
1

Hi Myoungshin Lee, 

 

Everytime you create a new object and want it to be saved in the Database you need to commit that object. If you don't the object itself won't be commited to the database and is not available for other use. 

 

More information about objects and commiting can be found here

 

Perhaps start with the basics by doing one (or both) of these learning paths in the academy:

 

image.png

answered
0

Hey Myoungshin Lee!

 

As Aswin said you need to do a commit if you want to store the information in the database. 

Just to add something, you should avoid to commit elements one by one or every time you do a change (sometimes is not neccesary). 

For example, if you are looping over a list and you are changing the items of the list, you can commit the list directly outside the loop to store all the changes, or if you have created an object and then you are chaging that object afterwards, you only need to set the commit on the last change or after the last change activity.

This is because the transactions are done after the end of the microflow.

Hope this helps you.

 

Kind regards,

Emilio

answered
0

The commit activity has an unfortunate name in Mendix, as it has a different behavior than commit in a database. It's actually an insert/update, commit is done automatically at the end of your transaction.

answered