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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:45:36+00:00 2026-05-12T11:45:36+00:00

I am trying to integrate together JOTM and Hibernate EntityManager to test my EJBs

  • 0

I am trying to integrate together JOTM and Hibernate EntityManager to test my EJBs in a transactional manner environment but out-of-container.

My test looks like the following:

  1. Start JOTM
  2. Put JOTM’s UserTransaction into JNDI
  3. Create and configure StandardXADataSource
  4. Put the DataSource into JNDI
  5. Configure hibernate and create EMF
  6. Create an EM
  7. Begin a transaction
  8. Join the transaction in EM
  9. Store an entity
  10. Verify it is stored
  11. Rollback the transaction
  12. Check the database for the count of records
  13. Tear everything down

Here is what my code looks like:
http://pastebin.com/m22a9f6b

Here is the logging output:
http://pastebin.com/m6da9383a

The test fails on step 12 (line 121).

As you can see, even though I have roll-backed the transaction, there is a record in the DB. Seems like transactions where not used at all and the record got through into the db.

Do you have any ideas how this could be happening and how to fix it?

  • 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-12T11:45:36+00:00Added an answer on May 12, 2026 at 11:45 am

    I figured out I need to provide my own implementation of ConnectionProvider that would return XAConnection instead of simple connections. This way transactions seem to work

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

Sidebar

Related Questions

I'm trying to integrate passport into my nodejs server using connect, but can't seem
I'm trying to integrate bean validation using hibernate validator to my web application :
trying to integrate hibernate and spring ,I ran into this error SEVERE: Context initialization
I've been trying to piece together how stack memory is handed out to threads.
Am trying to integrate goople map api with a jquery plugin- gMap. It looks
Im trying to integrate Brad Larson's GPUImage framework to my project. The sample code
I'm trying to integrate Video4Linux in my managed application. Indeed I've declared all required
Hi I'm trying to integrate MySpace with my Android app. As I'm new to
I am currently trying to integrate Paypal's MECL in an already existing IOS project
I am trying to integrate the new Open Graph objects , actions and aggregations

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.