Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:30:35+00:00 2026-06-04T13:30:35+00:00

Folks, what’s the difference between Open Session in View and Session per request pattern?

  • 0

Folks, what’s the difference between Open Session in View and Session per request pattern?
I am using Spring MVC and Hibernate .
I am not talking about the transaction demarcation here, for Session per request seems to be 1 session:1 tx. But for OSIV, there is 1 session and then there are multiple transactions(1 for each service call). Can someone please shed some light on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:30:36+00:00Added an answer on June 4, 2026 at 1:30 pm

    The definining characteristic of OSIV isn’t really the multiple transactions, but rather that the session remains open while the view is being rendered. This page on the JBoss wiki illustrates this setup (though managing transactions manually from the web layer is not my cup of tea… for something more pre-packaged, see Spring’s OpenSessionInViewFilter).

    There is one session, one transaction. This is stil OSIV, because all the work, including rendering the view is done inside the scope of the session. Note that even if you mark all your service methods as @Transactional (or the XML equivalent), they will still participate in the same single transaction unless they specifically require a new transaction to be started.

    So OSIV can be a type of session-per-request, and they are sometimes used interchangeably. But I would say that it is possible to have a session per request implementation that is not OSIV, if you make sure to close your single session prior to view rendering.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Folks, I've got an ASP.NET MVC application that I am attempting to secure using
Folks, I'm trying to open a youtube video in fancybox using the following code:
Folks, I'm using i nternal:merge tool since I'm not a big fan of GUI
Folks, We have been using OpenXml APIs found in System.IO.Packaging for creating a package
Folks, I'm tryning to extract data from web page using C#.. for the moment
Folks, why jQuery hover does not work? Here is the link - http://layot.prestatrend.com/ Thanks
Folks, I am trying to understand the relationship between video bitrate, image size, codec,
Folks, I am creating an installer project in Visual Studio. This is done using
Folks, I have just joined a company where they are using WSAD 5.1 which
Folks, Im considering using a microORM such as Dapper.net for the read access component

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.