So I'm facing a dilemma where my app uses hibernate version to prevent optimistic locking, but returns a PDF from a StreamResponse. When the user uses the submit action to generate a PDF, a few items are first saved to the database from a web service which causes the version to increment followed by the PDF being returned as a StreamResponse in my onSuccess method. The problem I'm having is the hidden field within the form containing the previous version isn't being updated do to the fact the StreamResponse doesn't reload the page. This causes the form to fall out of sync with the database causing a serverside validation error.
My question is whether or not there is away to update form data with a Zone while the StreamResponse is being returned? I'm open to alternate suggestions as well.