Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320375 - Login Denied because of invalid password because of 2 threads which are in DatasouceLogin.prepareProperties
Summary: Login Denied because of invalid password because of 2 threads which are in Da...
Status: RESOLVED DUPLICATE of bug 318187
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 07:15 EDT by Clementi Ursula CLA
Modified: 2022-06-09 10:09 EDT (History)
3 users (show)

See Also:


Attachments
StackTrace of LoginDenied (4.32 KB, text/plain)
2010-07-20 07:22 EDT, Clementi Ursula CLA
no flags Details
Changes made To DatasourceLogin (390.20 KB, image/pjpeg)
2010-07-20 07:23 EDT, Clementi Ursula CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Clementi Ursula CLA 2010-07-20 07:15:57 EDT
Build Identifier: 2.0.2.v20100323-r6872

if the applications uses JNDIConnetion, then a problem can occurs when 2 threads want to create a new login and both of them are in DatasourceLogin.prepareProperties.  Because both of them decryt the password the password is decrypted twice and the login fails, eg. for Oracle

Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied

Solution: Make method synchronized

Reproducible: Sometimes

Steps to Reproduce:
1.Use JNDI Connectivy
2.Configure your Connection parameter that Connections are often opened
3.Make many parallel tasks
Comment 1 Clementi Ursula CLA 2010-07-20 07:22:15 EDT
Created attachment 174725 [details]
StackTrace of LoginDenied
Comment 2 Clementi Ursula CLA 2010-07-20 07:23:23 EDT
Created attachment 174726 [details]
Changes made To DatasourceLogin
Comment 3 Michael OBrien CLA 2010-07-20 09:39:06 EDT
>Ursula,
   Thank you for the patch, we will need to see how synchronizing the method affects performance based on queueing concurrent access to this method by hammering a multithreaded SE app.
   
I would like to read your comments to the method could you post a transalation of the text - thank you /michael
Comment 4 Clementi Ursula CLA 2010-07-21 03:14:50 EDT
This is a translated more describing comment of the method

Within the project Gabor the problem rised, that two threads are in this method
concurrently, it seems that the password is decrypted twice. The effect was that
the login was that eclipse want to login with
Connect user = GABOR_SLES9ORA10 
passwort = 4A827CAEBD34A76F07F84E00F3FA0C03D2AEA351E127A79B
instead of correct password = GABOR_SLES9ORA10
We found this with some printouts in this method after decyprting the password
Normaly wenn everything is ok the output look like this 

Password before 4A827CAEBD34A76F07F84E00F3FA0C03D2AEA351E127A79B
 Password decrypted , GABOR_SLES9ORA10
Connect user = GABOR_SLES9ORA10 passwort = GABOR_SLES9ORA10

I case of a wrong password i looks like this 

Password before 4A827CAEBD34A76F07F84E00F3FA0C03D2AEA351E127A79B
Password before 4A827CAEBD34A76F07F84E00F3FA0C03D2AEA351E127A79B
Password decrypted , 4A827CAEBD34A76F07F84E00F3FA0C03D2AEA351E127A79B
Connect user = GABOR_SLES9ORA10 passwort = 4A827CAEBD34A76F07F84E00F3FA0C03D2AEA351E127A79B

In the stacktraces of the threaddumps we saw that thow thread are in this method.

This leads to the problem that it was not possible to make new connections and the user also was locked in oracle administrations because to many wrong logins !
Comment 5 Michael OBrien CLA 2010-07-21 12:03:11 EDT
Ursula, thank you for above, we will discuss this bug in the 2.2 prioritization queue, you may as a non-committer vote on it to raise it's priority
Comment 6 Chris Delahunt CLA 2010-08-17 11:28:25 EDT
I believe this is resolved with the fix for 318187 (putting synchronization on the decrypt method)and so am closing this as a duplicate.  The fix for 318187 is available in 2.1.1 and main in the nightly builds as of 2010-08-09.

*** This bug has been marked as a duplicate of bug 318187 ***
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:05:54 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 8 Eclipse Webmaster CLA 2022-06-09 10:09:35 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink