Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351374 - "user" property in DatasourceLogin not removed when calling setUsername(null)
Summary: "user" property in DatasourceLogin not removed when calling setUsername(null)
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David Minsky CLA
QA Contact: Project Inbox CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-06 17:25 EDT by David Minsky CLA
Modified: 2022-06-09 10:06 EDT (History)
0 users

See Also:


Attachments
Proposed patch and testcase (3.52 KB, patch)
2011-07-06 17:57 EDT, David Minsky CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Minsky CLA 2011-07-06 17:25:47 EDT
DatasourceLogin is initialized with a default "user" property and an empty ("") username. Some drivers don't like the "user" and "password" properties, and therefore these should be easily removable from the DatasourceLogin's internal properties (passed at runtime to the driver/DS).

Problem:

1. Calling DatasourceLogin >> setUserName(null) does not remove the "user" property from the internal properties, and therefore the property is still passed at runtime. Inconveniently the following workaround must be used instead:

   DataSourceLogin.getProperties().remove("user");

2. Calling DatasourceLogin >> setPassword(null) removes the "password" property from the internal properties, so there is an element of inconsistency to the way that this works currently.

Proposing that calling DatasourceLogin >> setUserName(null) remove the "user" property from the DatasourceLogin's internal properties list.
Comment 1 David Minsky CLA 2011-07-06 17:56:38 EDT
6117441
Comment 2 David Minsky CLA 2011-07-06 17:57:01 EDT
Created attachment 199215 [details]
Proposed patch and testcase
Comment 3 David Minsky CLA 2011-07-14 18:28:56 EDT
Fixed in trunk (2.4) at revision: 9733
2.3.1 checkin pending
Comment 4 David Minsky CLA 2011-07-15 17:20:40 EDT
Checked into 2.3.1 at r9746
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:06:33 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink