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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:38:49+00:00 2026-06-15T17:38:49+00:00

I’m a beginner in Java EE and I’m developing a web application which has

  • 0

I’m a beginner in Java EE and I’m developing a web application which has lots of database operations. I’m confused about transactions in Java EE.

My problem is that I’m using Tomcat and I don’t know about the types of transactions in Java EE, but I have to use them on my project. So, I have searched many times for it and got so many “kides” of that:

  1. Using connection.setAutoCommit(false), but it is connection managed?

  2. Using Javax.Transaction.UserTransaction

What are the differences between these two, and is there any other way?

I’m using NetBeans 7.0 and Tomcat is integrated with it. When I try to use javax.transaction.UserTransaction it’s unable to autocomplete this interface, but is does gives a suggestion for java.transaction.xa;

so what should i do???

Note: I can’t use EJB because Tomcat is the web server that is provided to me by the hosting server.

  • 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-15T17:38:50+00:00Added an answer on June 15, 2026 at 5:38 pm

    As you pointed out. There are many meanings of the word “transaction”. One popular meaning is a database transaction.

    • A database transaction is a collection of database operations that are atomic (either all succeed or all fail), consistent (the database must be valid before and after the transaction), isolated (other transactions may not see changes until the transaction is complete), and durable (once committed a transaction is persisted).

    These transaction can be managed at the connection level, typically with connection.setAutoCommit(false), connection.commit(), and connection.rollback().

    The other kind of transaction you have found is the JTA transaction. A JTA transaction is a very abstract concept and simply surrounds a “set of operations”. By itself, JTA does nothing with transactions. Typically however, people will plug JTA resource managers which do something when transactions start or finish.

    For example, someone could setup a messaging resource manager to make sure JMS messages are only sent out when a transaction is committed. Someone could also use a database resource manager to start and stop the database transaction (descried above) when the JTA transaction is started and stopped.

    JTA has a significant configuration overhead and can be quite a bit of work to setup. It is usually only used when you need to manage a cluster of resources (e.g. a cluster of databases) and coordinate among them.

    If you have only a single database then you can get away with using transactions on JDBC directly. If you are using something on top of JDBC (e.g. JPA) then these tools will often manage your transactions for you.

    A popular approach is to use Spring managed transactions. Spring is similar to JTA in that it has a very generic definition of transaction but it is quite a bit easier to configure. Going with Spring has two distinct advantages. The first is that they’re transaction demarcation (using the @Transactional annotation) is sometimes a lot easier than dealing with commit and rollback (don’t need to have quite so many try/catch/finally statements). Another reason is that if you end up moving to a cluster you can always plug in JTA beneath Spring later on.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I have been unable to fix a problem with Java Unicode and encoding. The
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has

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.