I have hibernate configured to print out the sql statements that it generates and i have a background task that runs every 10 seconds which uses hibernate and ends up printing out the same sql statement again and again … etc.
Is there a way to configure hibernate to print out sql statements but only print each statement once and ignore printing it out in the future?
update: It seems there is no way to configure this in hibernate, I ended up using the Spring JDBC for this frequently executing query to avoid the query being printed to the console, every 10 seconds during development. I will keep this question open in case some one figure out an easy way to do it.
you could implement your own
log4net.Appender.IAppenderwhich uses a set to determine if it already printed it or not