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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:24:44+00:00 2026-05-27T20:24:44+00:00

when I print the isolation level DatabaseMetaData dbMetaData = conn.getMetaData(); if (dbMetaData .supportsTransactionIsolationLevel(Connection.TRANSACTION_SERIALIZABLE)) {

  • 0

when I print the isolation level

 DatabaseMetaData dbMetaData = conn.getMetaData();
             if (dbMetaData                         .supportsTransactionIsolationLevel(Connection.TRANSACTION_SERIALIZABLE)) {
                     System.out.println("Transaction Isolation level= "
                                     + conn.getTransactionIsolation());
                     System.out.println(dbMetaData.getDefaultTransactionIsolation());
             }

for the connection I get an integer value 4
and for the database I get a value 2

I want to set the isolation level as SERIALIZABLE as it seems to work for most of the problems(that’s what i heard anyways :-/) but i am not getting as to how to set it as its asking for a int value

conn.setTransactionIsolation(level);

what does the integer levels refer to and in which order to the transaction levels? I am using mysql database

  • 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-27T20:24:44+00:00Added an answer on May 27, 2026 at 8:24 pm

    The Connection class should have all the isolation levels defined as constants. Go to the Javadoc and you can see the constants.

    conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE );
    

    NOTE: TRANSACTION_SERIALIZABLE might not be the one what you want. I suggest you read this tutorial.

    print readable string

    String getReadableLevel(int isolation)
    {
    String result="";
    
    switch(isolation)
    {
      case Connection.TRANSACTION_SERIALIZABLE: result="TRANSACTION_SERIALIZABLE";break;
      ...//u get the idea
    }
    return result;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This: use test; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; BEGIN TRANSACTION; EXEC sp_RENAME 'table1.asd'
I am trying to figure out which isolation level (among serializable and read committed
I need to print out data into a pre-printed A6 form (1/4 the size
Can i print out a url /admin/manage/products/add of a certain view in a template?
;print out division message mov rcx, 0 ;zero out register mov rax, [input] mov
PHP Print_r is useful to print out array and dictionary collection. is asp.net build
I print out the output of C preprocessor by using gcc -E a.c The
Should I run ALTER DATABASE DbName SET ALLOW_SNAPSHOT_ISOLATION OFF if snapshot transaction (TX) isolation
Print all 12 verses of the popular holiday song . By 12 verses I
print <ul>; foreach ($arr as $value) { echo(<li> . $value[storeid] . . ($value[dvdstock] +

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.