Why do we have the commit option for non persitant objects?

0
Why do we have the commit option for non persitant objects what is the purpose of commiting the non persistant objects?
asked
2 answers
0

Hi Naveen,

The commit option in Mendix serves different purposes for persistable and non-persistent objects. Let me break it down for you:

  1. Persistable Objects:

    • When you commit a persistable object, it gets stored in the database. This means that its data becomes permanent and can be retrieved even after restarting the application.
    • Committing a persistable object is essential for maintaining data consistency and ensuring that changes are durable.
  2. Non-Persistent Objects:

    • Non-persistent objects exist only in memory and are not stored in the database.
    • When you commit a non-persistent object, it doesnโ€™t get saved to the database. Instead, it stores the current attribute values and association values in memory.
    • The purpose of committing a non-persistent object is to allow for rollback. If you need to revert to the original values, you can do so by rolling back to the committed state.
    • Keep in mind that external objects cannot be committed1.

In summary, committing non-persistent objects is useful for maintaining in-memory state and enabling rollbacks, while committing persistable objects ensures data persistence in the database. Happy Mendix development! ๐Ÿ˜Š๐Ÿ‘

answered
0

Hi Naveen,

 

When you need to store data in a database, you use a persistable entity. A non-persistable entity cannot be stored in the database; it exists only in runtime memory.

For example, a form input that collects user data temporarily before processing or validation would use a non-persistable entity."

 

I hope this helps you understand the concept better !!

answered