当前位置: 首页 > news >正文

微企点建好网站后要怎么做做网站不会配色怎么办

微企点建好网站后要怎么做,做网站不会配色怎么办,宁波工商注册咨询电话,开发者选项怎么打开设置database 不生效剖析 前言配置加载类问题commons-pool 对象池 主页传送门#xff1a;#x1f4c0; 传送 前言 事情是这样的 今天在拉取了同事的代码做redis缓存设置的时候#xff0c;发现即使已经设置了database, 但是存数据的时候还是用的默认0数据库。这引起了我的好… 设置database 不生效剖析 前言配置加载类问题commons-pool 对象池 主页传送门 传送 前言 事情是这样的 今天在拉取了同事的代码做redis缓存设置的时候发现即使已经设置了database, 但是存数据的时候还是用的默认0数据库。这引起了我的好奇遂开始琢磨是什么情况造成的这种现象。 配置 上述仅为测试代码问题为了便于维护可以这么写 spring:redis:host: ${REDIS_HOST:localhost}port: ${REDIS_PORT:6379}password: ${REDIS_PASSWORD:}database: ${REDIS_DATABASE:0}加载类 然后通过RedisConfiguration 加载 ConfigurationProperties(spring.redis) public class RedisConfiguration {private String host;private int port;private String password;private int database;// getters and setters... } 问题 上网找了一系列的文章都没解决后来仔细观察研究发现是database多了个空格正确的该是这样没想到一个空格浪费了这么多时间 信心满满的以为这就万事大吉了结果一运行发现依然不可以后又开始检查,最后发现是少了几个依赖 发现没有引入commons-pool2依赖加上了依赖之后再运行发现已经切换了 commons-pool 对象池 引入Commons Pool对象池用于缓存Redis连接的原因是因为Lettuce本身是基于Netty的异步驱动在异步访问时并不需要创建连接池但基于Servlet模型的同步访问时连接池是有必要的。目的是为了复用对象以减少创建对象的开销所以一定记得要加这个依赖。 /*** Creates an instance that can be served by the pool and wrap it in a* {link PooledObject} to be managed by the pool.** return a {code PooledObject} wrapping an instance that can be served by the pool** throws Exception if there is a problem creating a new instance,* this will be propagated to the code requesting an object.*/PooledObject makeObject()throws Exception;/*** Destroys an instance no longer needed by the pool.* p* It is important for implementations of this method to be aware that there* is no guarantee about what state codeobj/codewill be in and the* implementation should be prepared to handle unexpected errors.* /p * p* Also, an implementation must take in to consideration that instances lost* to the garbage collector may never be destroyed.* /p** param p a {code PooledObject} wrapping the instance to be destroyed** throws Exception should be avoided as it may be swallowed by* the pool implementation.** see #validateObject* see ObjectPool#invalidateObject*/void destroyObject(PooledObject p)throws Exception;/*** Ensures that the instance is safe to be returned by the pool.** param p a {code PooledObject} wrapping the instance to be validated** return codefalse/code if codeobj/codeis not valid and should* be dropped from the pool, codetrue/codeotherwise.*/boolean validateObject(PooledObject p);/*** Reinitializes an instance to be returned by the pool.** param p a {code PooledObject} wrapping the instance to be activated** throws Exception if there is a problem activating codeobj/code,* this exception may be swallowed by the pool.** see #destroyObject*/void activateObject(PooledObject p)throws Exception;/*** Uninitializes an instance to be returned to the idle object pool.** param p a {code PooledObject} wrapping the instance to be passivated** throws Exception if there is a problem passivating codeobj/code,* this exception may be swallowed by the pool.** see #destroyObject*/void passivateObject(PooledObject p)throws Exception; 注意   Jedis 和Lettuce 是Java 操作Redis 的客户端。 在Spring Boot 1.x 版本默认使用的是Jedis 而在Spring Boot 2.x 版本默认使用的就是Lettuce。 所以如果你用的是1.x版本的话 需要把 RedisConnectionFactory factory 替换为LettuceConnectionFactory lettuceConnectionFactory 如果喜欢的话欢迎 关注 点赞 评论 收藏 一起讨论你的支持就是我✍️创作的动力
http://www.w-s-a.com/news/591890/

相关文章:

  • lol英雄介绍网站模板工商局网上注册
  • 电商网站运营策划什么样的网站容易做seo
  • 网站备案需要什么流程怎么创建小程序卖东西
  • 陇西网站建设 室内设计持啊传媒企业推广
  • 连云港做网站制作首选公司如何让单位网站做防护
  • wordpress企业网站源码开发网站用什么工具做设计
  • 网站负责人不是法人seo神马网站推广器
  • 网站建设绩效考核方案wordpress支付宝付款
  • 高要区住房和城乡建设局网站如何网上注销自己的公司
  • 哪种技术做网站容易论文答辩图片做记录片的是哪个网站
  • 怎样在微信中做网站网站的备案号在哪
  • 返利淘网站怎么做wordpress htnl短代码
  • 网站 手机 appwordpress管理账户
  • 徐州网站建设 网站制作做招商网站的前景怎么样
  • 网站开发就业岗位鹧鸪哨网站1v1深度开发
  • 在线手机动画网站模板网站登录注册怎么做
  • 苏州品牌网站设计晋江论坛兔区是什么
  • 怎么利用代码做网站重庆网络营销网站建设销售
  • 用dw怎么做网站留言板百度举报网站
  • 成都微网站设计企业为什么要做网络营销推广
  • 双桥区网站制作企业网站一般内容包括哪些
  • 莆田外贸专业建站做app 需要先做网站吗
  • 网站怎么用北京口碑最好的装修公司
  • 潮州网站建设深圳微信分销网站设计
  • asp.net网站开发实例教程pdf泉州seo网站关键词优推广
  • 怎样建立一个企业网站dede 网站名称
  • 做网上竞彩网站合法吗免费网站建设品牌
  • 网站开发所需要的的环境客户关系管理的内涵
  • 优质做网站公司做软件的人叫什么
  • 徐州市徐州市城乡建设局网站首页网站建设刂金手指下拉十五