File deleted after logout

0
Hello community! I am facing a very strange issue in Mendix. I tried to simply add a file to an entity in a pop up form and the file gets deleted after I log out. It's as simple as described. Does anyone know why did that happen?
asked
2 answers
0

Hello,

From what you briefly described I can only guess it's an auto commit problem. This is well documented in the Mendix docs.


When an object is committed through a default Save button, a commit activity, or web services, it always triggers the commit events. The platform also evaluates all associated objects. To guarantee data consistency, the platform may also autocommit associated objects.

An autocommit is an automatic commit from the platform, which is done to keep the domain model in sync. If your application ends up having autocommitted objects, then you will have a modeling error. Since an association is also a member of an object, the association is stored in the database as well. This means that if you create an order line inside an order and the order line is the parent of the association, when you commit the order line, the order is autocommitted.


Hope this helps!

answered
0

This usually happens because the file (or its parent object) is not committed. If the file is uploaded to an uncommitted or non-persistent object, it exists only for the session and gets lost after logout.


Quick checks:


  • Make sure the file entity is a persistable specialization of System.FileDocument.
  • Ensure the file and its parent object are committed when you save the popup (not just closing it).


In short: no commit = file disappears after logout.


answered