Skip to content

Conversation

@ChristosKalaitzis
Copy link

@ChristosKalaitzis ChristosKalaitzis commented Dec 15, 2025

This is the bump up from version 42.6.0 to 42.7.8 for maven dependency postgresql.

There are active issues that put the whole project at risk, because there is a more strict handling of resolving tenants, entities have to assign a default schema and also it enforces the actual foreign-key rules defined in the database to save an object, you cannot just save a child with assigned parent if parent is a new object and not already existing to database.

Next changes should abort this default schema, mutate the tenant resolver classes and have extra configuration about tenants if needed. This is a complex task and hard to test across platform.

@ChristosKalaitzis
Copy link
Author

ChristosKalaitzis commented Dec 15, 2025

This is a much needed change to correctly resolve tenants while booting spring.
It doesn't fully resolve the problem but it occurs to better tenant behavior.

I removed the default schema at entities and put a default schema at TenantResolver.java to correctly resolve tenants at application startup. Without this, the application fails to identify any schema, and fails to start.

public static String getTenantName() {
Map<String, Object> properties = thread.get();
String datasetName = "";
String datasetName = "dataset_0"; // default schema
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essential to resolve a schema before startup

tableValue.setIdTableSchema(schemaId);
tableValue = tableRepository.save(tableValue);
}
LOG.info("[CHRIS] TableValue: {}", tableValue);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to remove the logs starting with [CHRIS]
Also not sure if this part of the code is needed currently, I have to check it

@deniaAthanasakou
Copy link
Contributor

You can proceed with the merge

@Id
@GenericGenerator(name = "record_sequence_generator",
strategy = "org.eea.dataset.persistence.data.sequence.RecordValueIdGenerator")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "record_sequence_generator")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be removed

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.

3 participants