I am not sure why it doesn't show sql statement. I have it working before (on older spring, I am using 3 this time)
In ApplicationContext I have :
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>my.model.*</value>
</list>
</property>
</bean>
In log4j:
# Standrd System.out appender
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.Threshold=DEBUG
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
# package override setting
log4j.logger.org.hibernate.SQL=DEBUG, stdout
log4j.additivity.org.hibernate.SQL=false
log4j.logger.org.displaytag=INFO
log4j.rootLogger=DEBUG, stdout
Everything else seems fine, but it just doesn't show me the sql.
Did I miss anything?
(Or is it possible to print from SessionFactory from org.hibernate.cfg.Environment.getProperties()? It is not showing the show_sql, probably not even injected properly?)
Please help Thanks in advance!