Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the benefits of session-per-conversation?

Currently I'm using a session-per-request approach to manage Hibernate sessions in a Java web application. I heard the term session-per-conversation thrown around and was wondering what situations it suits and what benefits it can bring over session-per-request?

like image 351
Max Stewart Avatar asked Nov 05 '22 22:11

Max Stewart


1 Answers

One of the main benefits I've experienced is that you can implement behavior where not every change should directly be committed to the database -- Session per conversation will allow you to set up objects over multiple requests, and only commit to the db on the final 'yes I really want to do this' action. Typical scenarios for this are things like booking a hotel room using a wizard-like series of pages.

like image 182
Simon Groenewolt Avatar answered Nov 11 '22 07:11

Simon Groenewolt