Quote:
- The single tenant datasource-based connection provider like org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl allows the unwrapping of the DataSource.
That's because the DatasourceConnectionProviderImpl wraps a single DataSource so we know to which dataSource to unwrap.
Quote:
- However a multitenant datasource-based implementation like org.hibernate.service.jdbc.connections.spi.DataSourceBasedMultiTenantConnectionProviderImpl only allows the unwrapping of MultiTenantConnectionProvider and AbstractMultiTenantConnectionProvider.
For a multitenant environment where you have multiple DataSources, which one do you think we could choose if we decide to unwrap to a DataSource? remamber that this method does not take a tenant identifier.
Quote:
Could our hibernate gurus explain us what are the best implementation for these two methods?
I tried to find where these two methods are used, and couldn't find any specific place where they are needed. Do you have any specific issue related to them? Otherwise, just use the AbstractMultiTenantConnectionProvider logic.