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

  • Home
  • SEARCH
  • 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 7681871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:26:25+00:00 2026-05-31T18:26:25+00:00

Currently I developed a JCA outbound adapter (with LocalTransaction support) and I’ve got some

  • 0

Currently I developed a JCA outbound adapter (with LocalTransaction support) and I’ve got some troubles with connection management. My adapter works well, except the server (WebLogic 12c) does not put the ManagedConnections back to the pool. According to JavaDoc, the server must call ManagedConnection.cleanup() to reinitialize the connection and put it back to the pool, but it does not.

When I use the adapter from EJB, the server creates a new ManagedConnection, begins a new transaction, commits it, but does not call the ManagedConnection.cleanup() method and does not put it back to the pool.

Below you can see my testing bean:

@Stateless(mappedName = "TestingBean")
@Local(value = TestingBeanLocal.class)
@Remote(value = TestingBeanRemote.class)
@TransactionManagement(value = TransactionManagementType.CONTAINER)
@TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)
public class TestingBean implements TestingBeanCommon{

@Resource(mappedName = "eis/myJCA")
private MyDataSource dataSource;

@Override
public void performTestAction(String param1, String param2) {
    MyConnection connection = dataSource.getMyConnection();
    connection.performAction(ActionFactory.getSomeAction(param1, param2));
}
}

After 10 invocations I get the following:

Got Initial context
javax.ejb.EJBException: EJB Exception: ; nested exception is:
java.lang.RuntimeException: javax.resource.spi.ApplicationServerInternalException: Unable to get a connection for pool = “eis/myJCA”, weblogic.common.resourcepool.ResourceLimitException: Configured maximum limit of (0) on number of threads allowed to wait for a resource reached for pool eis/myJCA

As you noticed, it uses a new transaction for each invocation (REQUIRES_NEW attribute). The Server creates a new ManagedConnection instance first 10 times and then the connection pool reaches its maximal capacity.

It is clear from tracing the logs that no single call of ManagedConnection.cleanup() occurs and every connection in the pool is busy. I’ve read the JCA spec and discovered that the adapter can send lifecycle events to listeners using callback functions, but any attempt to use those event listeners callbacks ended with a new Exception:

javax.ejb.EJBException: BEA1-001471C1E76DE5A4E067; nested exception is:
weblogic.transaction.nonxa.NonXAException: java.lang.IllegalStateException: [Connector:199175]This ManagedConnection is managed by a container for its transactional behavior and has been enlisted to a JTA transaction by a container; application/adapter must not call the local transaction begin/commit/rollback API. Reject event LOCAL_TRANSACTION_COMMITTED from adapter.
javax.ejb.EJBException: EJB Exception: ; nested exception is:
java.lang.IllegalStateException: [Connector:199175] This ManagedConnection is managed by a container for its transactional behavior and has been enlisted to a JTA transaction by a container; application/adapter must not call the local transaction begin/commit/rollback API. Reject event LOCAL_TRANSACTION_ROLLEDBACK from adapter.

I suppose WebLogic does not wait for any event (maybe I’ve sent the wrong one?).

So, what am I doing wrong? How to make the server put connections back to the pool?

UPD: I discovered that connection events are very important to the server. A server manages connections based on events info, that were send to listeners, which it registers to ManagedConnection. Now I supported events in my adapter, but WebLogic still does not want to put connections back to the pool. Currently I get following events in logs:

  1. LOCAL_TRANSACTION_STARTED
  2. CONNECTION_CLOSED
  3. LOCAL_TRANSACTION_COMMITTED

It looks fine for me (the CONNECTION_CLOSED event means application closed the connection, I added close method, that sends this event). Commit successful and no Exceptions appears. It seems that I’ve sent events in right order (earlier WebLogic throws Exceptions, but now stops doing it), but the server still does not put connections back to the pool.

I am confused.

  • 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-31T18:26:27+00:00Added an answer on May 31, 2026 at 6:26 pm

    It seems that I’ve resoved this issue. When I looked in WebLogic console I discovered that ManagedConnection instances have -1 active handlers. So I decided to comment MyConnection.close() method call, which I added to my testing bean to send the CONNECTION_CLOSED event. After this chages have been made connection pooling began working great. I tried to modify my testing bean and set its transaction attribute to NOT_SUPPORTED. After that ManagedConnections in pool had 1 active handler. So i put back MyConnection.close() line and connection pooling starts working again.

    I assume, that sending the CONNECTION_CLOSED event is wrong in case of transaction propagation. Also I assume that method ManagedConnection.close(), which sends the CONNECTION_CLOSED event should be used in case of single transaction. But it seems strange to me, that WebLogic does not want to cleanup ManagedConnections and put them back to pull if they have negative number of active handlers.

    Thanks a lot for help.

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

Sidebar

Related Questions

I am web developer who currently works mostly on his own but, some projects
My website currently uses a custom jQuery gallery system that I've developed... it works
I currently have a web project developed with Codeigniter. My production environment works as
I'm currently learning how to make some plugins for eclipse. I first developed a
We currently have developed an application using WCF. Our clients make connections to different
Currently I am hosting a Django app I developed myself for my clients, but
I've developed an application (C#) that currently sits on a a number of workstations.
I have developed a few Delphi Win32 (currently using D2007) applications, which revolve around
I'm currently integrating a CMS (developed in PHP) authentication with Active Directory. This specific
I'm new to developing, currently only developed on web, like php,html,css,javascript etc etc. Any

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.