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

  • SEARCH
  • Home
  • 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 6077105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:41:00+00:00 2026-05-23T10:41:00+00:00

I have an application that uses hibernate version 3.6.4, and c3p0 version 0.9.1.2 for

  • 0

I have an application that uses hibernate version 3.6.4, and c3p0 version 0.9.1.2 for connection pooling. My underlying RDBMS is MySql version 5.0.67.

My installation of MySql indicates that the default transaction isolation level is “REPEATABLE-READ” (4):

mysql> select @@GLOBAL.tx_isolation, @@tx_isolation;
+-----------------------+-----------------+
| @@GLOBAL.tx_isolation | @@tx_isolation  |
+-----------------------+-----------------+
| REPEATABLE-READ       | REPEATABLE-READ |
+-----------------------+-----------------+

I have not changed or configured the transaction isolation level within hibernate.cfg.xml or anywhere within my application. From the app, I use the following code to print configuration:

DatabaseMetaData meta = getSession().connection().getMetaData();
System.out.println("Default Tx Isolation: " + meta.getDefaultTransactionIsolation());
System.out.println("Current Tx Isolation: " + getSession().connection().getTransactionIsolation());

And I get the following results:

Default Tx Isolation: 2 (=READ_COMMITTED)
Current Tx Isolation: 4 (=REPEATABLE_READ)

So, my questions are the following:

  1. Where did the “2” value came from? Since the default is the REPEATABLE_READ, why getDefaultTransactionIsolation() returns READ_COMMITTED?
  2. What is the isolation level that hibernate uses after all? REPEATABLE_READ or READ_COMMITTED?
  3. I thought that when no isolation level is set, hibernate should use the underlying database’s default. Is this true? Maybe the jbdc driver implementation sets a default on its own and hibernate uses 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-05-23T10:41:01+00:00Added an answer on May 23, 2026 at 10:41 am

    looks like meta.getDefaultTransactionIsolation());
    is hardcoded in the implementation of DatabaseMetaData in the mysql driver

    public class DatabaseMetaData implements java.sql.DatabaseMetaData
    lines….

    
    1475    public int getDefaultTransactionIsolation() throws java.sql.SQLException JavaDoc {
    1476        if (this.conn.supportsIsolationLevel()) {
    1477            return java.sql.Connection.TRANSACTION_READ_COMMITTED;
    1478        } else {
    1479            return java.sql.Connection.TRANSACTION_NONE;
    1480        }
    1481    }
    

    so i’d bet and trust getSession().connection().getTransactionIsolation()

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

Sidebar

Related Questions

I have an application that uses Hibernate to connect to my MySQL database. I'm
I have a struts application that uses Hibernate to access a MYSQL DB. I
We have an application that uses Hibernate's 2nd level caching to avoid database hits.
I have an application that uses Hibernate for its domain objects. One part of
I have an application that uses hibernate and JPA to handle the database. I
I have a JPA/Spring application that uses Hibernate as the JPA provider. In one
I have a stand-alone, Swing application that uses Hibernate for its persistence layer. I
I have a client application that connects to a server. The server uses hibernate
I have an application that uses Hibernate/JPA, with Spring and Jersey. In my application
I have an application that uses hibernate. At one part I am trying to

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.