Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Transactions not working in eclipselink(Transactions not working in eclipselink)
Transactions not working in eclipselink [message #1858048] Mon, 13 March 2023 11:05 Go to next message
Sanjana C is currently offline Sanjana CFriend
Messages: 23
Registered: December 2022
Junior Member
We are working on Migration of Toplink to Eclipselink in our project.

We are extending base Junit class with AbstractTransactionalDataSourceSpringContextTests class from spring 2.0 in our existing Project which has many convenient methods to handle transactions(end transaction,start transaction).

So Same class I am trying to use to test the transactions after migrating to eclipselink but the transactions are not getting committed. The reason I can see from debug is TransactionStatus does not hold the object that needs to be persisted. I have highlighted the UnitOfWork which gets changed while executing the query and committing the transaction in Eclipsselink_UOW.PNG .

I have also tried with @Transactional annotation and AbstractTransactionalJUnit4SpringContextTests from spring 5 but I can see transactions are not getting committed.


In persistence.xml

<persistence xmlns:xsi="" xsi:schemaLocation="" version="2.0" xmlns="">
<persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL">
<!-- <class></class>
<exclude-unlisted-classes />
<shared-cache-mode>NONE</shared-cache-mode><!-- true</exclude-unlisted-classes> -->
<property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@****" />
<property name="javax.persistence.jdbc.user" value="***" />
<property name="javax.persistence.jdbc.password" value="***" />
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.logging.level" value="ALL" />
<property name="eclipselink.logging.parameters" value="true" />
<!-- from iau-maris-opa -->
<property name="eclipselink.jdbc.bind-paramaters" value="true" />
<property name="" value="Oracle" />
<property name="eclipselink.persistence-context.flush-mode" value="commit" />
<property name="eclipselink.persistence-context.reference-mode" value="WEAK" />
<property name="eclipselink.weaving" value="static" />
<property name="eclipselink.weaving.eager" value="true" />
<!--<property name="eclipselink.cache.shared.default" value="true"/>-->

And for transaction manager in springxml:

<?xml version="1.0" encoding="windows-1252"?> <beans xmlns=""



<context:component-scan base-package="org.example"/> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">

<property name="persistenceXmlLocation" value="classpath:persistence.xml" />
<property name="dataSource" ref="dataSource" />
<property name="persistenceUnitName" value="persistenceUnit" />

<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true"/>
<property name="databasePlatform" value="org.eclipse.persistence.platform.database.SQLServerPlatform"/>
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect" />
<!--<property name="jpaPropertyMap">
<prop key="eclipselink.weaving">false</prop>


<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
<tx:annotation-driven proxy-target-class="true"
transaction-manager="transactionManager" />

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="username" value="${}" />
<property name="password" value="${}" />
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="${*}" />


Am I missing any property to set ? Or is there any other way to be tested for eclipselink Could you please help me out on this as I am struct here to progress further?
Re: Transactions not working in eclipselink [message #1858050 is a reply to message #1858048] Mon, 13 March 2023 12:26 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33011
Registered: July 2009
Senior Member
It's best to ask here:

Ed Merks
Professional Support:
Previous Topic: Eclipse for Scientific Computing 2022-23 doesn't support SDM
Next Topic:falling at the first hurdle
Goto Forum:

Current Time: Sun Dec 10 16:48:05 GMT 2023

Powered by FUDForum. Page generated in 0.03362 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top