From 64fe46444bf55f06d7a7b533fb3169653420d573 Mon Sep 17 00:00:00 2001 From: JustinKSU Date: Thu, 28 Apr 2011 19:09:12 -0500 Subject: [PATCH] HHH-6169 - Only call getVersion methods if debugs is enabled --- .../jdbc/internal/JdbcServicesImpl.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/JdbcServicesImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/JdbcServicesImpl.java index e53cec1615..9cd72cfaff 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/JdbcServicesImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/JdbcServicesImpl.java @@ -113,19 +113,21 @@ public class JdbcServicesImpl implements JdbcServices, ServiceRegistryAwareServi Connection connection = jdbcConnectionAccess.obtainConnection(); try { DatabaseMetaData meta = connection.getMetaData(); - LOG.debugf( "Database ->\n" + " name : %s\n" + " version : %s\n" + " major : %s\n" + " minor : %s", - meta.getDatabaseProductName(), - meta.getDatabaseProductVersion(), - meta.getDatabaseMajorVersion(), - meta.getDatabaseMinorVersion() - ); - LOG.debugf( "Driver ->\n" + " name : %s\n" + " version : %s\n" + " major : %s\n" + " minor : %s", - meta.getDriverName(), - meta.getDriverVersion(), - meta.getDriverMajorVersion(), - meta.getDriverMinorVersion() - ); - LOG.debugf( "JDBC version : %s.%s", meta.getJDBCMajorVersion(), meta.getJDBCMinorVersion() ); + if(LOG.isDebugEnabled()) { + LOG.debugf( "Database ->\n" + " name : %s\n" + " version : %s\n" + " major : %s\n" + " minor : %s", + meta.getDatabaseProductName(), + meta.getDatabaseProductVersion(), + meta.getDatabaseMajorVersion(), + meta.getDatabaseMinorVersion() + ); + LOG.debugf( "Driver ->\n" + " name : %s\n" + " version : %s\n" + " major : %s\n" + " minor : %s", + meta.getDriverName(), + meta.getDriverVersion(), + meta.getDriverMajorVersion(), + meta.getDriverMinorVersion() + ); + LOG.debugf( "JDBC version : %s.%s", meta.getJDBCMajorVersion(), meta.getJDBCMinorVersion() ); + } metaSupportsScrollable = meta.supportsResultSetType( ResultSet.TYPE_SCROLL_INSENSITIVE ); metaSupportsBatchUpdates = meta.supportsBatchUpdates();