Grid: how to manage data persistence

Hi,

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

[code]
class Person{
Integer id;
String name;
@OneToMany
Set addresses;

   //getters and setters

}
[/code]Addresses entity class

[code]
class Addresses{
Integer id;
String personAddress;
@ManyToOne
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

[code]
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())
              .collect(Collectors.toList());
          container=new BeanItemContainer<>(Addresses.class, addressList);
          addressesGrid=new Grid("Addresses for Person "+person.getName());
          addressesGrid.setEditable(true);
          Grid.Column addressOrderCol=addressesGrid.getColumn("addressOrder");
          addressOrder.setEditable(true);
          //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