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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:31:01+00:00 2026-05-13T07:31:01+00:00

Using Spring : can jta-transaction-manager use id as name so that I can pass

  • 0

Using Spring:

  1. can jta-transaction-manager use id as name so that I can pass it as REF to my service layer like below?

  2. is tx:jta-transaction-manager can only be used for je22 container? I mean for Tomcat, I need to do it manually, like below:

    <tx:jta-transaction-manager id="name_transactionmanager"/>
    
        <bean id="projectService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
            <property name="transactionManager"
                      ref="name_transactionmanager"/>
            <property name="target">
                <bean
                  class="com.company.project.company.services.ServiceImpl"
                  init-method="init">
                     <property
                       name="HRappsdao"
                       ref="HRappsdao"/>
                     <property
                       name="projectdao"
                       ref="projectdao"/>
                </bean>
            </property>
            <property name="transactionAttributes">
                <props>
                    <prop key="store*">PROPAGATION_REQUIRED</prop>
                    <prop key="update*">PROPAGATION_REQUIRED</prop>
                    <prop key="remove*">PROPAGATION_REQUIRED</prop>
                    <prop key="bulkUpdate*">PROPAGATION_REQUIRED</prop>
                    <prop key="*">PROPAGATION_SUPPORTS,readOnly</prop>
                </props>
            </property>
        </bean>
    

For question 2

    <bean id="transactionManager"
      class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="userTransaction">
            <bean class="org.springframework.transaction.jta.JotmFactoryBean"/>
        </property>
    </bean>
  • 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-13T07:31:02+00:00Added an answer on May 13, 2026 at 7:31 am

    Can tx:jta-transaction-manager use id as name so that I can pass it as REF to my service layer like below?

    The <tx:jta-transaction-manager> exposes the transaction manager as a Bean in the Spring context with the name “transactionManager“.

    Can tx:jta-transaction-manager only be used with a J2EE container?

    Quoting the Chapter 9. Transaction management from the Spring documentation:

    Is an application server needed for transaction management?

    The Spring Framework’s transaction
    management support significantly
    changes traditional thinking as to
    when a J2EE application requires an
    application server.

    In particular, you don’t need an
    application server just to have
    declarative transactions via EJB. In
    fact, even if you have an application
    server with powerful JTA capabilities,
    you may well decide that the Spring
    Framework’s declarative transactions
    offer more power and a much more
    productive programming model than EJB
    CMT.

    Typically you need an application
    server’s JTA capability only if you
    need to enlist multiple transactional
    resources, and for many applications
    being able to handle transactions
    across multiple resources isn’t a
    requirement. For example, many
    high-end applications use a single,
    highly scalable database (such as
    Oracle 9i RAC). Standalone transaction
    managers such as Atomikos Transactions
    and JOTM are other options. (Of course
    you may need other application server
    capabilities such as JMS and JCA.)

    The most important point is that with
    the Spring Framework you can choose
    when to scale your application up to a
    full-blown application server. Gone
    are the days when the only alternative
    to using EJB CMT or JTA was to write
    code using local transactions such as
    those on JDBC connections, and face a
    hefty rework if you ever needed that
    code to run within global,
    container-managed transactions. With
    the Spring Framework, only
    configuration needs to change so that
    your code doesn’t have to.

    So, as explained in the third paragraph, if you want to work with multiple transactional resources, you’ll need global transactions which involve a JTA capable application server. And JTA capable application server means a real J2EE container or a non J2EE container (like Tomcat) with a standalone transaction manager like Atomikos, JOTM, Bitronix, SimpleJTA, JBossTS or GeronimoTM/Jencks.

    FWIW, I’ve seen lots of complains about JOTM, I think that GeronimoTM/Jencks lacks of documentation, I can’t really say anything about JBossTSArjunaTS (except that it’s a rock solid product), SimpleJTA and Bitronix have both good documentation and Atomikos is an impressive product greatly documented too. Personally, I’d choose Bitronix or Atomikos.

    PS: Honestly, if this sounds like Chinese to you, you should maybe consider using a single database (if this is an option, go for it!) or consider using a real J2EE container like JBoss or GlassFish as I wrote in a previous answer. No offense but all this JTA stuff is not trivial and taking the JOTM path is not that simple if you don’t really understand why you need it.

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

Sidebar

Related Questions

I'm using Spring, Spring Security, BlazeDS, Flex and spring-flex. I know that I can
This is crazy... been using Spring for a while but can't find something like
Hi i want to create an application that works like spring quartz i can
I am using Spring with JDBC and found that it is autocommit. How can
when using spring rest server side generate json, it will looks like below {userInfo:{id:123,userFullName:full
Is it correct that one can create spring beans using just the @Component annotation
Using spring DefaultAnnotationHandlerMapping how can I lookup the Controller that would ultimately handle a
I am using Spring framework. Should my service classes be created as singletons? Can
I am using spring-ws for a web service and can't seem to figure out
I'm using Spring Security 3.0.7 How can I get with java code the access

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.