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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:36:36+00:00 2026-06-03T14:36:36+00:00

AFAIK, there are two types of entity manager. 1. Container managed entity manager 2.

  • 0

AFAIK, there are two types of entity manager.
1. Container managed entity manager
2. Application managed entity manager

  1. Container managed entity manager
    • This type of em uses JTA transaction only

Below is my code:

@PersistenceContext(unitName = "", type = Transaction)
EntityManager em;


public void persist(T entity) {
em.persist(entity)
}

Questions:
There is exception throw when execute the code : TransactionRequireException
Why there is this kind of exception? There is no TransactionRequireException happen after added @Resource UserTransaction to the method persist(). I wonder UserTransaction is belongs to JTA right.

EntityTransaction et = em.getTransaction();

Refer to the above code, Why JTA transaction type cannot invokes getTransaction() ?

Can extended JTA Transaction em use outside of EJB?

  1. Application managed entity manager
    • Utilize JTA Transaction
    • Utilize JDBC Transaction(Resource Local Transaction)

Please anyone provide example of source code on JDBC Transaction type.

  • 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-03T14:36:38+00:00Added an answer on June 3, 2026 at 2:36 pm

    A JPA persistence unit can either be JTA or RESOURCE_LOCAL.

    If you use JTA, then you must use JTA for transaction, either through SessionBeans or by accessing JTA directly.

    See,
    http://en.wikibooks.org/wiki/Java_Persistence/Runtime#Java_Enterprise_Edition

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

Sidebar

Related Questions

This is a best practices type of question. AFAIK there are two approaches (and
AFAIK, there are two ways of passing data to the view from controller :
How do I accumulate values in T-SQL? AFAIK there is no ARRAY type. I
AFAIK there is only a vulnerability within the HEADERS of an email when using
AFAIK, there are two approaches: Iterate over a copy of the collection Use the
AFAIK when reducing an array we can only output once variable at the end
In my application the main thread creates two joined threads; one which waits for
Possible Duplicate: Is there any particular difference between intval and (int)? These two statements
I want to see how phonetically similar two non-English strings are, AFAIK soundex and
AFAIK there's no boolean value representation, and I need to specify a boolean true/false

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.