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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:52:38+00:00 2026-05-16T03:52:38+00:00

Is anybody out there using iBATIS 3 as their persistence framework inside an EJB

  • 0

Is anybody out there using iBATIS 3 as their persistence framework inside an EJB container? I recently started building a new system for which I choose EJB 3.1 (the version of EJB is actually irrelevant to this question) as my app framework and iBATIS 3 (this version is relevant!) as my persistence framework. My business logic is implemented in EJB 3.1 session beans that use iBATIS 3 for data access. I am running on GlassFish v3)

My issue with this stack has been transaction management. I have solved my problem by writing some simple integration code, but I was little surprised I had to do this. So I decided to post this to see if others have run into this and if so how they solved the problem.

My requirement is for iBATIS 3 to transparently use the EJB transaction (typically defined declaratively) in the session bean method. iBATIS 3 provides 2 transaction factories JdbcTransactionFactory and ManagedTransactionFactory and I found that neither one works correctly in an EJB environment (and looking at the iBATIS source it is clear why it fails).

The JdbcTransactionFactory is inappropriate since I want any calls to sqlSession.commit() or sqlSession.rollback() to be ignored. So I thought ok I should use the ManagedTransactionFactory since it does cause any calls to sqlSession.commit() or sqlSession.rollback() to be ignored, however it also causes sqlSession.close() to not close the connection that iBATIS opened from the DataSource in sqlSession.open() (the DataSource is a container managed DataSource object I provide to iBATIS). This causes the GlassFish to exhaust its connect pool and the application fails.

So I wrote a new TransactionFactory implementation, EJBTransactionFactory, that causes sqlSession.commit() or sqlSession.rollback() to do nothing, but does close the connection when sqlSession.close() is called.

I suspect other people have run into this, how did you solve 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-16T03:52:38+00:00Added an answer on May 16, 2026 at 3:52 am

    This ended up getting discussed/resolved here: http://www.mail-archive.com/user-java@ibatis.apache.org/msg16138.html

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

Sidebar

Related Questions

I was wondering if anybody out there is doing their software builds using something
Is anybody out there using Project Lombok for a large scale production system? How
I was wondering whether anybody out there is actively using Rhapsody TestConductor ? Or
Anybody out there using BGL for large production servers? How many node does your
Anybody out there who had developed plugins for eclipse? I am using eclipse for
Wondering if anybody out there has any success in using the JDEdwards XMLInterop functionality.
Does anybody know of a good library out there for developing for Facebook using
Does anybody out there know how to setup Eclipse with MinGW or Cygwin to
Im just wondering if theres a recommended syntax validator out there anybody can recommend?
Has anybody out there used the SWIG library with C#? If you have, what

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.