The non-persistable entity can have event handlers for DB-related events even though they would not be saved to the database. - Mendix Forum

The non-persistable entity can have event handlers for DB-related events even though they would not be saved to the database.

1

Hi, developers

The non-persistable entity can have event handlers for DB-related events even though they would not be saved to the database.

Do you think that makes sense?

I added four event handlers related to database action, as shown in the screenshot below.

image.png

 

Implementing event handlers for new and deleted events makes sense because it could be done in memory.

But will the commit and rollback make sense? It worked from the below flow design.

image.png

image.png

 

 

 

 

 

 

 

 

Posted
1 comments

Hi YONGPYO JANG,

 

The event handlers are not only DB-related, it can be also used client-side in memory. So, It makes sense to have those events in Non-persistent entities, as they can be commited into memory (not database) as stated by the Mendix documentation:

 

"Committing non-persistable entities records the current attribute values and association values in memory, allowing a rollback to revert to these values."

 

I hope that information can help you, best regards,

Oswaldo

Created
Wow, thank you, Oswaldo. Now it's clear. Have a good day.
Created