Committed objects removed on logout - Mendix Forum

Committed objects removed on logout

1
Jun 20 11:28:11.766 - WARNING - Core: (1/4) Some autocommitted objects still existed on logout for session 'x'.
Jun 20 11:28:11.766 - WARNING - Core: (2/4) Autocommitted objects are newly created objects which were not yet committed, but are inserted into the database because an associated object was committed.
Jun 20 11:28:11.766 - WARNING - Core: (3/4) Autocommitted objects should explicitly have been committed, please check your model and apply the necessary changes. The autocommitted objects have been deleted from the database to prevent database corruption.Number of autocommitted objects per type which still existed for this session:
Jun 20 11:28:11.766 - WARNING - Core: (4/4) - Recruitment.Interview: 1 object(s).

In the application we're building, a user can add new applications for a recruitment process. When adding an application, also a new interview is made.
When a user logs out after saving (which commits both the application and the interview) we still get the previous message.

What happens in the microflow is the following:

There is a list of interviews which is filtered (in this case both lists contain the same interviews), when one of the lists is committed, the message above is displayed (when debugging both lists show that the state of the interviews and the application is 'normal’).

I fixed it by committing both lists, then the message does not appear anymore. 

However, this seems not logical to me, is there anyone who can explain to me why a committed object is removed when logging out of the application?

asked
2 answers
1

This should be fixed in version 7.23 

“We fixed an issue where an object which was initially auto-committed and then explicitly committed in a before-commit action was still treated as auto-committed one. (Ticket 78384)” 

And i believe it’s a broader fix than just before-commit actions. Because I used to have a similar issue as you’re describing in versions 7.16 – 7.21 or something like that. And it’s fixed since i upgraded.

answered
0

Hi Cecile,

Short answer: autocommitted isn't actually committed.

 

You always need to explicitly commit your objects in your microflow, otherwise objects will be removed on logout. This includes autocommitted objects.

 

Objects can become autocommitted, if they have a reference to an object which is committed to the database.

The example Mendix always uses is Creating an OrderLine within an Order, and committing the Orderline, will autocommit the Order, since the association parent is OrderLine:

 

Mendix Docs

answered