// synchronized to avoid multi-thread access issues; defined as method synch to avoid
// potential deadlock issues due to nature of code.
if ( session.getFactory().getSettings().isWrapResultSetsEnabled() ) {
try {
log.debug("Wrapping result set [" + rs + "]");
return new ResultSetWrapper( rs, retreiveColumnNameToIndexCache( rs ) );
}
catch(SQLException e) {
log.info("Error wrapping result set", e);
return rs;
}