I have a big Entity object in my web project.(JAVA spring, hibernate, spring-boot) On update of a field in POJO object, I have to push some events to queue and do some actions non transactionally.
I have two questions //First Question Right Now I am planning to write an aspect object which does these non transactional actions and event pushing. I have @transactional on service layer methods(for which the aspects are written). Does failure in these aspect methods will rollback the transaction of service layer method ?
//Second Question I have provided two ways of updating fields in POJO Object. 1) Individual rest api for each field. 2) An api for updating entire Object.(Only not null fields will be updated here)
In the second case I need to check whether a field is updated or not and perform event pushing for each field.(Code looks clumsy here)
Is there any elegant way of solving this problem?
Aucun commentaire:
Enregistrer un commentaire