java - Transaction with request scope with MyBatis and Spring -


is there way setup mybatis springmvc have 1 transaction whole http request? there hibernate opensessioninviewfilter in mybatis or should write own filter fulfill such behavior?

you confused notions "session" , "transaction". osiv opens session, in 1 session several transactions may coexist. should put @transactional attributes services used controllers, depending on business requirements.

moreover, 1 big transaction anti-pattern. ideally have read-write transaction user's actions, , read-only transaction build response user. saves resources, because database locks taken inserts/updates released earlier.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -