Grid: how to manage data persistence


I want to prompt users for confirmation before persisting edited data to the database. I am using a grid with a beanitemcontainer.
This is my structure:

Person entity class

class Person{
Integer id;
String name;
Set addresses;

   //getters and setters

[/code]Addresses entity class

class Addresses{
Integer id;
String personAddress;
Person person;
BigInteger addressOrder;
Users lastEditedByUser;
BigDecimal someCalculation;

 //getters and setters

[/code]Person View with addresses list ordered by addresses->addressOrder where addressorder is ordered by from the most prefered to the least prefered

class PersonView extends Window{
FormLayout headerLayout; //Populated with components bound from Person bean
Grid addressesGrid;
BeanItemContainer container;

   VerticalLayout layout;

   public PersonView(Person person){
          List<Addresses> addressList=person.getAddresses().stream()
              .sorted((a, b)->a.getAddressOrder().compareTo(b.getAddressOrder())
          container=new BeanItemContainer<>(Addresses.class, addressList);
          addressesGrid=new Grid("Addresses for Person "+person.getName());
          Grid.Column addressOrderCol=addressesGrid.getColumn("addressOrder");
          //other view configurations

[/code]the problem is whenever a user edits the addressOrder, it is immediately persisted to the database even when the users closes the window without saving. is there a way i can overcome this. Utilizing the commit handler does not make sense as the window is closed without saving (committing) any data (and still any changes are persisted to the db).

​Thanks for your response

Vaadin: 7.6.8
Mysql: 5.1.36
Hibernate 5.2.0
Webserver: jetty 9