]
Sanne Grinovero updated HHH-5790:
---------------------------------
Assignee: Sanne Grinovero
Fix Version/s: 3.6.5
Summary: method BasicBinder#bind() and BasicExtractor#extract missing guards for
trace logging (was: method BasicBinder#bind() slow because formatting for trace is done
also with disabled trace)
method BasicBinder#bind() and BasicExtractor#extract missing guards
for trace logging
-------------------------------------------------------------------------------------
Key: HHH-5790
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5790
Project: Hibernate Core
Issue Type: Improvement
Affects Versions: 3.6.0
Environment: 3_6_0_final
Reporter: Guenther Demetz
Assignee: Sanne Grinovero
Fix For: 3.6.5
Original Estimate: 5m
Remaining Estimate: 5m
In the ELSE block of method org.hibernate.type.descriptor.sql.BasicBinder#bind
the if statement "if (log.isTraceEnabled())" is missing, so strings are
formatted
even if trace logging is disabled.
CURRENT CODE:
if ( value == null ) {
if ( log.isTraceEnabled() ) {
log.trace(String.format(...);
}
st.setNull( index, sqlDescriptor.getSqlType() );
}
else {
log.trace(String.format(BIND_MSG_TEMPLATE,index, ...);
doBind( st, value, index, options );
}
IMPROVEMENT:
if ( value == null ) {
if ( log.isTraceEnabled() ) {
log.trace(String.format(...);
}
st.setNull( index, sqlDescriptor.getSqlType() );
}
else {
if ( log.isTraceEnabled() ) { //// NEW LINE
log.trace(String.format(BIND_MSG_TEMPLATE,index, ...);
} //// NEW LINE
doBind( st, value, index, options );
}
BTW: By doing this little code enhancement, I was able to achieve almost the double speed
when inserting data.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: