mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 14:30:16 +00:00
HHH-12392 - Caching SchemaResolver delegate with multiple data sources
This commit is contained in:
parent
3a2ab40314
commit
00be50331f
@ -34,7 +34,6 @@ private DefaultSchemaNameResolver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void determineAppropriateResolverDelegate(Connection connection) {
|
private void determineAppropriateResolverDelegate(Connection connection) {
|
||||||
if ( delegate == null ) {
|
|
||||||
// unfortunately Connection#getSchema is only available in Java 1.7 and above
|
// unfortunately Connection#getSchema is only available in Java 1.7 and above
|
||||||
// and Hibernate still baselines on 1.6. So for now, use reflection and
|
// and Hibernate still baselines on 1.6. So for now, use reflection and
|
||||||
// leverage the Connection#getSchema method if it is available.
|
// leverage the Connection#getSchema method if it is available.
|
||||||
@ -59,8 +58,10 @@ private void determineAppropriateResolverDelegate(Connection connection) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ignore) {
|
catch (Exception ignore) {
|
||||||
log.debugf( "Unable to resolve connection default schema : " + ignore.getMessage() );
|
log.debugf(
|
||||||
}
|
"Unable to use Java 1.7 Connection#getSchema : An error occurred trying to resolve the connection default schema resolver: "
|
||||||
|
+ ignore.getMessage() );
|
||||||
|
delegate = SchemaNameResolverFallbackDelegate.INSTANCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user