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 4321392
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:44:26+00:00 2026-05-21T08:44:26+00:00

Im working on a webapplication with Spring Framework 3 and Hibernate 3.6 and I

  • 0

Im working on a webapplication with Spring Framework 3 and Hibernate 3.6 and I try to understand how transaction management works.
I use mySQL Server 5.1 with InnoDB tables. I wrote my DAO based on plain Hibernate 3 API.

1) Is it correct, that mySQL Server itself specifies how transactions are handled? That means it decides when records need to be locked or not?

2) When I declare a method in spring as @transactional(readOnly=true) or @transactional(readOnly=false) does this affect if the datarecords are locked during the transaction? This means, when readOnly=true, no datarecord is locked and when readOnly=false all used datarecords are locked?

3) What happens when I got readOnly=true and I read various data records. Lets assume in the middle of reading they are changed by another transaction, so that I get some old records and some new records. Is that possible?

4) When does a commit happen? After a successful transaction or when a session is closed?

5) when does a hibernate-session start? for each session (between server and client) or for each transaction?

6) in the end, who has the responsibility for transaction management? spring or mysql or both?

Thanks for answering! 🙂

  • 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-05-21T08:44:26+00:00Added an answer on May 21, 2026 at 8:44 am

    1) Is it correct, that mySQL Server itself specifies how transactions are handled? That means it decides when records need to be locked or not?

    In essense – yes, implementation of transactions is a responsibility of DBMS

    2), 3) …

    readOnly has nothing to do with transactions, it’s a hint for Hibernate which says that Hibernate shouldn’t propagate changes made to the loaded object to the database (i.e. you can specify it as a performance hint if your transaction isn’t intended to write changes to the database)

    4) When does a commit happen? After a successful transaction or when a session is closed?

    Commit is an action that terminates a transaction (another such action is rollback), therefore it happens at the end of transaction.

    5) when does a hibernate-session start? for each session (between server and client) or for each transaction?

    By default – for each transaction, unless you configured Open Session in View support.

    6) in the end, who has the responsibility for transaction management? spring or mysql or both?

    Database provides implementation of transactional behaviour. Spring manages transactions by defining their boundaries and triggering commit/rollback.

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

Sidebar

Related Questions

I'm working with JBoss 4 & Spring. In a web application, I use Quartz
I am working on a web application, where I transfer data from the server
I am working on a web application using Python (Django) and would like to
I am working on a web application (J2EE) and I would like to know
I am working on a web-application in which dynamically-created images are used to display
I am working on a web application in Java which gets data from servlets
I'm working in a web application using VB.NET. There is also VisualBasic code mixed
I am working on a web application and I have run into the following
I am working on a web application (ASP.NET) game that would consist of a
I'm working on a web application that will return a variable set of modules

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.