[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-5790) method BasicBinder#bind() and BasicExtractor#extract missing guards for trace logging
Sanne Grinovero (JIRA)
noreply at atlassian.com
Fri Jun 3 08:07:25 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sanne Grinovero resolved HHH-5790.
----------------------------------
Resolution: Fixed
> 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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list