Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317524 - JTA related exception occurs when non-JTA data source is used
Summary: JTA related exception occurs when non-JTA data source is used
Status: CLOSED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-21 18:15 EDT by marvin.huang CLA
Modified: 2022-06-09 10:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marvin.huang CLA 2010-06-21 18:15:15 EDT
Build Identifier: 1.0.2

We're having problems using eclipselink with Weblogic data source. We were able to get connection successfully from Weblogic data source connection pool but we encountered an issue which seems to be related to JTA. In one of our operation we acquire an UnitOfWork object from client session and acquire another UnitOfWork object from same session to read some stuffs from DB, release it, and finally commit the first UnitOfWork object. It looks like:

// acquire first UnitOfWork object
UnitOfWork uow1 = clientSession.acquireUnitOfWork();

// do some work with uow1
....

// acquire another UnitOfWork
UnitOfWork uow2 = clientSession.acquireUnitOfWork();

// read things from DB
uow2.executeQuery();

// release 2nd UnitOfWork object
uow2.release();

// do some more work with uow1
...

// commit uow1
uow1.commit();

However we got the following error:

org.eclipse.persistence.exceptions.TransactionException:
Exception Description: Error committing externally managed transaction
Internal Exception: weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=org.eclipse.persistence.transaction.JTASynchronizationListener@2c0e5a1

Exception Description: UnitOfWork [UnitOfWork(
DatabaseAccessor(connected)
Oracle11Platform)] was rendered inactive before associated externally managed transaction was complete.

We didn't want to use external JTA controller so in sessions.xml we have
<external-transaction-controller>false</external-transaction-controller>

Also in Weblogic data source configuration we disabled "Supports Global Transactions" for our data source. Not sure why it still complained about JTA. Just wonder if we missed anything? Appreciate for the help!

Reproducible: Always

Steps to Reproduce:
1. configure non-JTA data source in Weblogic
2. configure sessions.xml to use external connection pool while not using external transaction controller
3. acquire first UnitOfWork from ClientSession
4. acquire second UnitOfWork from same ClientSession
5. execute read query from second UnitOfWork and then release 2nd UnitOfWork
6. commit first UnitOfWork and get the following error:

org.eclipse.persistence.exceptions.TransactionException:
Exception Description: Error committing externally managed transaction
Internal Exception: weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=org.eclipse.persistence.transaction.JTASynchronizationListener@2c0e5a1
Comment 1 Doug Clarke CLA 2010-06-21 21:46:56 EDT
It appears to be using an external transaction controller.

Can you show the code that bootstraps the shared server session reading the sessions.xml file?
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:25:15 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink