• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

disbale isDebugEnabled in Hibernate

 
jan dressen
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate uses Log4J for logging, which is very good. But we have a lot of database transactions, and hibernate calls the isDebugEnabled() method millions of times in our application which causes a delay of up to 20 seconds when adding a lot of data. is there some way to supress this? disabled log4j causes the logger not to log, but the check is still done. it would be more efficient if the check for isDebugEnabled() happend only once, not over and over again...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, that's how log.debug works--it checks to see if debug is enabled.

Are you sure that's where the slowdown is happening? I mean, Hibernate is pretty expensive anyway, especially if you're adding "huge" amounts of data, whatever that means. Consider batching, custom SQL, etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic