I’m running into a bug with the UI framework where if i submit a form and i get sent back to the form with validation errors, the changes i made get persisted to the DB (premature hibernate flushes), after some debugging i figured out the cause of this was due to the fact that
MessageSourceServiceImpl is transactional, spring will attempt a flush on returning from any transactional method where readOnly attribute is not set to true:
How is this related to the ui framework and the bug i was running into? Because when the form has validation errors, the field error widget in uicommons module calls a method in
MessageSourceServiceImpl to translate the error codes that doesn’t have
readOnly set to true therefore the changes always gets flushed to the DB. I believe
MessageSourceServiceImpl shouldn’t be transactional in the first place since it doesn’t have any DAO interaction. I will go ahead and create a ticket to fix this unless some one thinks otherwise.