数据库oracle 里面没有实时更新数据,但是其他用户访问我机器,可以看到新的数据,是为什么?

解决方案 »

  1.   

    你是想在Service层管理事务吗?
    可以把<property name="target">
                <ref bean="guestbookManager"></ref>
            </property>抽出来加上 parent="guestbookManager"
      

  2.   

    参考下
    [XML code]
          <!--hibernate 事务管理对象-->
        <bean id="transactionManager"
              class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory">
                <ref local="sessionFactory"/>
            </property>
        </bean>
        <!--事务工厂-->
        <bean id="baseProxy" lazy-init="true" abstract="true"
              class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
            <property name="transactionManager">
                <ref bean="transactionManager"/>
            </property>
            <property name="transactionAttributes">
                <props>
                    <prop key="save*">PROPAGATION_REQUIRED</prop>
                    <prop key="update*">PROPAGATION_REQUIRED</prop>
                    <prop key="delete*">PROPAGATION_REQUIRED</prop>
                    <prop key="login*">PROPAGATION_REQUIRED</prop>
                    <prop key="find*">PROPAGATION_REQUIRED</prop>
                    <prop key="get*">PROPAGATION_SUPPORTS,readOnly</prop>
        <prop key="*">PROPAGATION_REQUIRED</prop>
                </props>
            </property>
        </bean>    <bean id="ancientBookService" parent="baseProxy">
    <property name="target">
    <bean class="cn.nlc.gsp.service.impl.AncientBookServiceImpl">
    <property name="ancientDao"><ref bean="ancientBookDao"/></property>
    <property name="otherDao"><ref bean="otherDao"/></property>
    <property name="unitDao"><ref bean="unitDao"/></property>
    </bean>
    </property>
        </bean>[/XML code]