Thank you for your answer, and sorry for being so long.
That was the first approach. But since the user can handle an object in different manner (see it, modify it, verify the changes, remodify it,...) and that each operation is in a separate request, that doesn't make sense not to keep the cache between two requests.
What we are going to implement is a session per user task (it is a bit more general than a single operation), and this session will connect to the database when necessary and will be disconnected, if necessary, when the request has been processed (just before the hand goes back to tomcat)
I have already seen all those articles (A Short Primer On Fetching Strategies, Open Session in View, Sessions and Transactions,...) and some of the huge amount of posts in the forum. But I didn't found what I needed (particularly about pessimistic locking strategies), so I asked directly here.
Regards,
joel.
|