Hello all,
i would like to use the Policies Feature in Jooq-Express,
and tested it in the Trial-Version.
It is working fine,
but i found some small things i want to ask about.
I have a "ConfigurationFactory" (in my quarkus-app) that should create the
Jooq-Configuration only once (for performance-reasons).
I used to do it like this:
public class Database1ConfigurationFactory {
private Configuration configuration;
public Configuration getConfiguration() {
if (configuration == null) {
...
configuration = new DefaultConfiguration()
...
}
}
}
But now, when i also add the Policies for the Tenant Check, i need to pass
the tenantId to the getConfiguration() function, so now the function
suddendly needs to return unique Configuration instances, for each tenantId.
I fear that this will negatively affect my performance.
It would look like this:
public class Database1ConfigurationFactory {
private Configuration configuration;
public Configuration getConfiguration(Integer tenantId) {
...
configuration = new DefaultConfiguration()
configuration.set(new DefaultPolicyProvider()
.append(CUSTOMER, CUSTOMER.CUSTOMER_ID.eq(tenantId))
...
);
...
return configuration
}
}
am i implementing this correctly (as intended) or is there another way to
apply the policies afterwards (maybe in a listened, like the
executionlistener or something similar?)
greetings, Bernd
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/9dfec149-8533-4280-bf09-86a2a38b72e2n%40googlegroups.com.