我对一个基表查询
A a=find("hql").get(0);
然后a.setProp(555);
然后对换一个字段查询
B b=find("ohterhql").get(0);
在第一次查询时没问题
在b的find时会将a setProp的值持久化到数据库中
这是为什么
hibernate不熟,请教各位
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9iDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
</props>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 支持 @Transactional 标记 -->
<tx:annotation-driven transaction-manager="transactionManager"
proxy-target-class="true" />
<!-- =========== openSessionInViewInterceptor ==============-->
<bean id="openSessionInViewInterceptor"
class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
hibernate3.2+spring2