|
Ideally we'd like a Session as a user-provided extension point needs to read some simple things from the database.
I'll explain the use case: building and app needing to shard data into a different Search index according to the language of its indexed entities (think about blogposts). As of today this requires a static list of indexes to be defined in the configuration, and to plug in a custom sharding implementation which would route from some value in the indexed entity to the appropriate index by name. (Assume a Blog entity having a getLanguageCode() property or equivalent).
To make this dynamic, instead of hard-coding all possible LanguageCode values in the configuration file it would be nice to run a select on the related entity; further additions would be added on-the-fly triggering additional indexes to be created but initially (at boot time) we need to know the existing set of indexes so that queries can be executed on all of them.
The sharding extension point is a user-provided implementation; I am sure people would be able to use JdbcServices as well, but I think they expect to be able to use a Session since we're using Hibernate and the query would target a mapped entity.
|