|
From: Per O. <po...@no...> - 2005-02-21 08:28:54
|
> > Yes, that's exactly how it would work, if you did indeed call down into > the tx wrapped service layer multiple times. Of course, it's usually not > appropriate to combine data from multiple transactions anyway, but one > common case of this is where you call down to get the form backing > object contents, and then later call down again with the modified > object. The deferred close strategy blows up in this scenario. One > workaround which Spring MVC makes pretty easy is to keep your form > backing object in the session session, from the previous get. Then you > end up only doing one call down into tx layer to apply changes. But > this _is_ a limitation, of course. > Hmm yeah, we did think about that too. Actually, we thought about it before deciding to use OpenSessionInView pattern, as using this pattern is exactly about accepting multiple calls into the tx layer to get more easy view development. This is also why I cannot see how the deferred close option will be an option for anyone to solve this problem, cause all using OpenSessionInView will have multiple calls from their view to back forms. This is one of the central ideas of using OpenSessionInView. Regards, Per |