Why is Field committable?

I’m new to Vaadin, and trying to understand a sample app that was built using Roo and JPAContainer. Nothing fancy - a simple form that allows me to edit a row from a table, backed by JPAContainer.

When I modify the form, and click on “Save”, it calls Form.commit. Looking at the form.commit code, it iterates over all the individual fields and calls field.commit for each field.

From the description of commit in the Buffered interface:

Does that not imply that every field will be independently committed? I presume it cannot be, otherwise it wouldn’t be an ACID transaction (ie: the last field in the form is invalid and cannot be committed, but the rest of the transaction has already been committed). Consequently, I’m not sure I understand the workflow. Does the JPAContainer buffer all the commit requests? Or does “commit” mean something else here?

Thanks!

Eric

Field has a commit() method because Properties can be used outside of Containers for data handling, and they may be buffered. The actual commit() method contents is up to the Property implementation; I’d hazard a guess that JPAContainer and it’s properties are aware of the DB transaction, and act accordingly.