Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

persistence_idGenerationMode_<ENTITY> is not applied #1737

Open
DanielBertocci opened this issue Oct 11, 2023 · 5 comments
Open

persistence_idGenerationMode_<ENTITY> is not applied #1737

DanielBertocci opened this issue Oct 11, 2023 · 5 comments

Comments

@DanielBertocci
Copy link

DanielBertocci commented Oct 11, 2023

According to the documentation, it is possible to override the default persistence.idGenerationMode:

**persistence.idGenerationMode.:** Since 2.2.0 Determines how entity ids are generated for this Entity Type. This overrides **persistence.idGenerationMode**.

Current Behavior:
If I try to set persistence_idGenerationMode_thing for example, the ovveride is not applied (it tried Thing capital case too).
During the startup in the startup log, the setting is not mentioned and appears to be ignored.

Expected Behavior:
If I use the environmental variables:
persistence_idGenerationMode is set to ServerGeneratedOnly
persistence_idGenerationMode_thing is set to ServerAndClientGenerated
Then:
The it is possible to create Things of the assigned id.

Logs:

2023-10-11 10:35:10 08:35:10.649 INFO   d.f.i.ilt.frostserver.settings.Settings - Setting persistence.persistenceManagerImplementationClass has value 'de.fraunhofer.iosb.ilt.frostserver.persistence.pgjooq.PostgresPersistenceManager'.
2023-10-11 10:35:10 08:35:10.649 INFO   d.f.i.ilt.frostserver.settings.Settings - Setting persistence.idGenerationMode has value 'ServerGeneratedOnly'.
2023-10-11 10:35:10 08:35:10.649 INFO   d.f.i.ilt.frostserver.settings.Settings - Setting persistence.autoUpdateDatabase has value 'true'.

Environment

Application Version:
fraunhoferiosb/frost-server-http:latest

@hylkevds
Copy link
Member

That's odd
In the logs there should be an entry for each EntityType listing what the id generation mode for that EntityType is. Can you find that in your logs?
Also, can you double check the version number that is listed in the log? Just in case Docker has an odd version for "latest".

@DanielBertocci
Copy link
Author

Sure:

FROST-Server.Core Version: v2.2.0-2-g485287a

This is the full log:
log.txt

@hylkevds
Copy link
Member

Thanks for the log. Unfortunately, in it, FROST is not fully initalised yet. It doesn't fully initialise the data model until the first request to an entity type is done...

@DanielBertocci
Copy link
Author

DanielBertocci commented Oct 18, 2023

I found out the issue and it is caused by a small inconsistency:
persistence_idGenerationMode_thing=ServerGeneratedOnly is case sensitive and to make it work has to be persistence_idGenerationMode_Thing=ServerGeneratedOnly with Thing in capital case.

This is an inconsistency because a setting like plugins_coreModel_idType_thing=STRING works.

I hope this can help!

@hylkevds
Copy link
Member

Indeed, that case different is confusing.
I'll look into it. It's probably most convenient if environment variable are not case sensitive at all...

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

No branches or pull requests

2 participants