小编mor*_*hai的帖子

比较字符串与速度

考虑速度模板中的以下代码段:

#set($brandName = $player.brand.name)
#set($brandNameExample = "NameExample")

#if($brandName == $brandNameExample)
    11111
#else
    22222
#end
Run Code Online (Sandbox Code Playgroud)

我总是得到22222。当然,player.brand.name = "NameExample"

任何人都可以解释我为什么以及如何让它工作吗?

velocity string-comparison

8
推荐指数
2
解决办法
3万
查看次数

Spring Jedis连接没有返回池中

我的应用程序是由Spring休息控制器使用redis调用服务.我使用的是spring boot starter redis 1.2.5,我在beans.xml文件中定义了一个模板:

<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
    p:host-name="${spring.redis.host}"
    p:use-pool="true" 
    p:port="${spring.redis.port}"
/>

<bean id="redisTemplateForTransaction" class="org.springframework.data.redis.core.RedisTemplate"
    p:connection-factory-ref="jedisConnectionFactory"
    p:keySerializer-ref="stringRedisSerializer"
    p:valueSerializer-ref="jsonRedisSerializerForTransaction"
    p:enableTransactionSupport="true">
    <qualifier value="redisTemplateForTransaction" />
</bean>
Run Code Online (Sandbox Code Playgroud)

当我启动超过8个查询时,我的应用程序阻止.我知道我已达到池中的默认连接数.

为什么在请求处理结束时没有自动返回连接?

如何在事务模式下工作,以便任何传入的请求将获得其redis连接并在处理结束时返回它?

java spring spring-mvc redis spring-transactions

6
推荐指数
1
解决办法
946
查看次数