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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:58:08+00:00 2026-05-31T10:58:08+00:00

Today i read about JTA api , i saw the class called UserTransactionManager. We

  • 0

Today i read about JTA api , i saw the class called UserTransactionManager. We have to start our transaction before we execute the SQL queries , so that if any exception happens we can rollback the changes.

Here my question is what exactly UserTransactionManager is doing? It is providing any stack .. to execute SQL query? How it is rollback the SQL query changes?

  • 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-31T10:58:10+00:00Added an answer on May 31, 2026 at 10:58 am

    UserTransactionManager is an interface. Your container provides the implementation at runtime.

    It uses a process called 2 phase commit where a “soft commit” happens and the rows are held in limbo, then a hard commit later. Here’s the basic overview:

    The container communicates with the database when you open the transaction using the XA protocol and says “Hey give me a connection, but don’t actually write anything till disk (‘commit’) until I tell you so.”

    Next, you run some queries, and flush them out to the database. When you flush your container asks the database, “Hey, run these queries, but don’t write anything until I tell you. If you can’t guarantee they’ll succeed throw and error immediately. If they will succeed, lock the rows and tables until you hear from me again and I give you the OK to commit”.

    Finally, your program closes the UserTransaction. The container then says to the database, “Ok all those rows you have locked, flush everything to disk (commit) and unlock them.”

    It’s actually more complicated then that, especially when you have coordinated global transactions… but basically if all the participants agree they can guarantee the commit, then they all commit, or nobody commits.

    Further reading:

    • http://en.wikipedia.org/wiki/ACID
    • http://en.wikipedia.org/wiki/Two-phase_commit_protocol
    • http://en.wikipedia.org/wiki/Distributed_transaction
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I read today about UNIX's pipes: If multiple processes are writing to a
Today I read that there is a software called WinCalibra (scroll a bit down)
I have used unions earlier comfortably; today I was alarmed when I read this
I read today about sharded counters in Google App Engine . The article says
I read about unions the other day( today ) and tried the sample functions
Today I've had a read about wordpress plugins, so far I understand that they
Read this question today about safe and unsafe code I then read about it
I've read about binary searches on Wikipedia for the first time today and just
Today I read about Restful services. Basically what I understand that is Restful webservices
I always read about the horrible thing that goto is. But today, reading about

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.