Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333756

Summary: testNonPooledConnection() failed on Spring with "Test problem: connection should be not pooled"
Product: z_Archived Reporter: Yiping Zhao <yiping.zhao>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: andrei.ilitchev
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
test patch none

Description Yiping Zhao CLA 2011-01-07 10:30:42 EST
Andrei added the test recently on Dec 17, 2010 in revision as for fix of bug 332683, the test failed on Spring with following error message:

Test problem: connection should be not pooled 

junit.framework.AssertionFailedError: Test problem: connection should be not pooled
at org.eclipse.persistence.testing.tests.jpa.advanced.EntityManagerJUnitTestSuite.testNonPooledConnection(EntityManagerJUnitTestSuite.java:10032)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:499)
Comment 1 Andrei Ilitchev CLA 2011-01-10 16:35:50 EST
Created attachment 186437 [details]
test patch

It seems that there is no way to pass EntityManager properties to a managed EntityManager in Spring: like app. server JTA case transaction is required to wrapped EntityManagerImpl to appear Spring's EntityManager wrapper; but unlike app. server JTA case, Spring immediately acquires connection on begin transaction therefore passing of connection properties after beginTransaction is too late - connection is already has been acquired.

In Spring case the test uses app. managed entity manager.
Comment 2 Andrei Ilitchev CLA 2011-01-10 16:38:54 EST
Fixed in trunk.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:16:15 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:33:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink