Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dirty Checking not occuring.

 
vikasids sharma
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all

I am using spring hibernate for my application .
I guess hibernate performs automatic dirty checking for any updates.
In my case even if i dont update/modify object , i could see lot of updates on my console (for complete graph of bject) on submission of form.

Please let me know if need to do any thing explicitly to have dirty checking feature.

IN my applicationContext , I am using ..

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="mappingResources">

<list>
<value><my .hbm files></value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.query.substitutions">true=1 false=0</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>

<!-- The Hibernate interceptor -->
<bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>

<!-- Hibernate Transaction manager -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>

<!-- Bean Configuration for the HibernateTemplate-->
<bean name="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory" />
</bean>


<bean id="myDao" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="target">
<bean class="MyDaoImpl">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
</property>
<property name="proxyInterfaces">
<value>MyDao</value>
</property>
<property name="interceptorNames">
<list>
<value>hibernateInterceptor</value>
</list>
</property>
</bean>


Thanks
Vikas
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to define a version property in your mapping then it should just work.
 
vikasids sharma
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:You will need to define a version property in your mapping then it should just work.


Hi Paul

Thanks for your reply . Can you please provide a bit insight like how it works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic