在我的查询(查找)得到缓存会话关闭之后,在新会话中,hibernate在通过随机写入Sql Query更改数据库之后驱逐所有内容,我该如何阻止它发生?我正在考虑为很少改变的事情制定政策.
INFO Executing [namedSqlQuery=dao.web_login, objs=[user1]]
DEBUG org.springframework.orm.hibernate3.SessionFactoryUtils user1- Opening Hibernate Session
DEBUG org.hibernate.impl.SessionImpl user1 - opened session at timestamp: 5511432318976000
DEBUG org.hibernate.impl.SessionFactoryImpl user1- evicting second-level cache: USERS_LOOKUP
DEBUG org.hibernate.impl.SessionFactoryImpl user1- evicting second-level cache: COUNTRY_LOOKUP
Run Code Online (Sandbox Code Playgroud)
ecache.xml
<cache name="query.oneHourPolicy"
maxElementsInMemory="10000"
eternal="false"
timeToLiveSeconds="3600"
diskPersistent="true"
overflowToDisk="true"/>
Run Code Online (Sandbox Code Playgroud)
spring hibernate配置
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">ehcache.xml</prop>
Run Code Online (Sandbox Code Playgroud) 我试图用公式A*EXP(-BX)对各个点(x,y)进行指数拟合,试图找到最适合我的点的A和B.
double[] xx = curveFitter.fit(new ParametricUnivariateFunction() {
public double value(double v, double... doubles) {
return doubles[0] * Math.exp(-1 * doubles[1] * v);
}
public double[] gradient(double v, double... doubles) {
return new double[]{v, 1};
}
}, new double[]{0, 0});
Run Code Online (Sandbox Code Playgroud)
我得到了一些数字,但它们不符合我的观点,似乎无法找到上述任何文档.
使用commons-math3-3.0