Regardless of the second level cache implementation you choose, the mechanisms for commiting changes to the database are the same as if you were not using it, i.e. when you commit your transaction your inserts/updates/deletes are made in the database.