• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Dirty Checking not occuring.

 
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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE 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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic