I have a strange requirement that I need to save records and group them by type and label them as version 1,2,3 in ascending contiguous order. I had solved this in CUBA with a trigger doing a select max query filtered by type on a before insert for a specific column and locking the table while i do this.
SELECT tbl_lock INTO varLockTable FROM my_locks WHERE tbl_lock ='target_table_to_lock' for update;
but this trigger is not fired when I insert a record on JMIX it does work if i manually add a record directly into the DB anyone has an Idea of why this happens? Strangest thing I raise a log inside of the trigger and I see it run but it does not save the calculated value if started from JMIX.