Skip to content

Conversation

@rPraml
Copy link
Collaborator

@rPraml rPraml commented Apr 14, 2025

When you define

final var props = new Properties(connectionProps);
props.setProperty("user", username);
props.setProperty("password", password);

and use the Map interface, e.g. props.keySet() will return exactly user and password

Only a direct access with property.getValue("someVal") will fall through to connectionProps

Unfortunately some drivers like H2 and also MariaDB use the Map interface of Properties, which does not expose the underlying default values.

I noticed this, as some custom connection properties were not correctly applied to the driver.

So the use of Properties(defaults) can be a trap.
This PR changes all places to copy the defaults to the new object.

@rbygrave this is IMHO a low hanging fruit ;)

@rbygrave rbygrave added this to the 9.6 milestone Apr 15, 2025
@rbygrave rbygrave merged commit e497938 into ebean-orm:master Apr 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants