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

Bug 323420

Summary: All Oracle TIMESTAMPType tests using alternative time zone failed with 11.2.0.2 driver
Product: z_Archived Reporter: Andrei Ilitchev <andrei.ilitchev>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.foundation-inbox, edwin.tang
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
suggested patch none

Description Andrei Ilitchev CLA 2010-08-23 14:09:46 EDT
The failure in all 36 tests looks the same:

	VERSION: Eclipse Persistence Services - @VERSION@.@QUALIFIER@
	TEST SUITE NAME: TIMESTAMP & TIMESTAMPTZ Types Test Suite with alternative time zone America/Los_Angeles
	SUITE DESCRIPTION: Tests the use of TIMESTAMP/TIMESTAMPTZ with TopLink

		VERSION:   Eclipse Persistence Services - @VERSION@.@QUALIFIER@
		TEST NAME:   WriteTypeObjectTest(class org.eclipse.persistence.testing.tests.types.TIMESTAMPDirectToFieldTester)
		TEST DESCRIPTION: The test writing of the intended object, 'NOW -> 2010-08-20 13:51:15.056 America/New_York EDT', from the database and checks if it was inserted properly
		##FAILURE##
		TEST TIME:      0
		TOTAL TIME:      15
		RESULT:      Error
		Local Exception Stack: 
		Exception [EclipseLink-0] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): org.eclipse.persistence.testing.framework.TestErrorException
		Exception Description: 
The tsToTSLTZ should be: 2010-08-20 13:51:15.056, but was read as: 2010-08-20 16:51:15.056
The utilDateToTSLTZ should be: Fri Aug 20 13:51:15 EDT 2010, but was read as: Fri Aug 20 16:51:15 EDT 2010
The timeToTSLTZ should be: 13:51:15, but was read as: 16:51:15
		Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): org.eclipse.persistence.testing.framework.TestErrorException
Exception Description: The object inserted into the database, 'NOW -> 2010-08-20 13:51:15.056 America/Los_Angeles PDT' does not match the original, 'NOW -> 2010-08-20 13:51:15.056 America/New_York EDT'.
	at org.eclipse.persistence.testing.tests.types.TIMESTAMPTester.verify(TIMESTAMPTester.java:492)
	at org.eclipse.persistence.testing.tests.types.WriteTypeObjectTest.verify(WriteTypeObjectTest.java:80)
	at org.eclipse.persistence.testing.framework.TestCase.execute(TestCase.java:157)
	at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:250)
	at org.eclipse.persistence.testing.framework.TestSuite.execute(TestSuite.java:75)
	at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:250)
	at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
	at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:250)
	at org.eclipse.persistence.testing.framework.TestExecutor.runTest(TestExecutor.java:671)
	at org.eclipse.persistence.testing.framework.ui.SynchronizedTestExecutor.run(SynchronizedTestExecutor.java:61)
Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): org.eclipse.persistence.testing.framework.TestErrorException
Exception Description: The object inserted into the database, 'NOW -> 2010-08-20 13:51:15.056 America/Los_Angeles PDT' does not match the original, 'NOW -> 2010-08-20 13:51:15.056 America/New_York EDT'.
	at org.eclipse.persistence.testing.framework.WriteObjectTest.verify(WriteObjectTest.java:268)
	at org.eclipse.persistence.testing.tests.types.WriteTypeObjectTest.superVerify(WriteTypeObjectTest.java:64)
	at org.eclipse.persistence.testing.tests.types.TypeTester.verify(TypeTester.java:79)
	at org.eclipse.persistence.testing.tests.types.TIMESTAMPTester.verify(TIMESTAMPTester.java:369)
	... 9 more


Oracle jdbc driver 11.1.0.7 TIMESTAMPLTZ.toTimestamp(conn, ltz.toBytes()) used to return timestamp corresponding to the time zone set on connection.
That was wrong (confirmed by Oracle jdbc team).
In 11.2.0.2 the method returns timestamp in GMT.

Eclipselink used to workaround the old behaviour, this should no longer be done for 11.2.0.2.
The failing checks shouldn't be done - they used to pass on the previous versions because of an even number of errors.
Comment 1 Andrei Ilitchev CLA 2010-08-23 14:13:08 EDT
Created attachment 177245 [details]
suggested patch
Comment 2 Andrei Ilitchev CLA 2010-08-23 14:19:25 EDT
Checked the patch into trunk (2.2); 2.2.1 is pending
Comment 3 Andrei Ilitchev CLA 2010-08-23 14:20:21 EDT
I meant 2.1.2 is pending
Comment 4 Andrei Ilitchev CLA 2010-09-01 11:09:17 EDT
Checked the patch into 2.1.2.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:21:41 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink