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

网站开发html工具商丘seo外包

网站开发html工具,商丘seo外包,自己开一个网站怎么赚钱,html做网站经验技巧原理 open-in-view 是 Spring Boot ⾃动加载 Spring Data JPA 提供的⼀个配置,全称为 spring.jpa.open-in-viewtrue,它只有 true 和 false 两个值,默认是 true。 这个配置为true时,会导致Web MVC请求处理的一开始&…
原理       

 open-in-view 是 Spring Boot ⾃动加载 Spring Data JPA 提供的⼀个配置,全称为 spring.jpa.open-in-view=true,它只有 true 和 false 两个值,默认是 true。
        这个配置为true时,会导致Web MVC请求处理的一开始,就从连接池取一个数据库连接放到本地线程变量;Web MVC请求处理结束后,才会归还给连接池
open-in-view 机制是为了解决在 mvc 的 controller 中使用了 hibernate 的 lazy load 的属性时 no session 抛出的LazyInitializationException 异常

        这个处理逻辑位于OpenEntityManagerInViewInterceptor.preHandle,在Sentinel处理代码SentinelResourceAspectExt之前,所以Sentinel限流无法阻止JPA取数据库连接。
 

隐患一


        如果业务代码中,有耗时操作,就导致数据库连接还回连接池变慢,进而引起雪崩效应,导致tomcat处理线程大量增加,而处理性能却无法提高,所有Web MVC请求都无法响应,应用提供的服务中断。

@ResponseBody
@RequestMapping(value = "/xxx/send", method = RequestMethod.POST)
@SentinelResource(value = "xxxdcc#send", entryType = EntryType.IN)
public SendXXXResp sendSms(@RequestBody SendXXXVo sendXXXVo) {//同步调用第三方系统,耗时超过一定时间,如3sSendXXXResp sendXXXResp = new SendXXXResp();return sendXXXResp;
}

        如果数据库连接池最大连接数为200,同步调用第三方系统耗时3s。那么这个接口的QPS达到70时,会导致应用雪崩,整个应用无法提供服务。

隐患二

        当jpa与mybatis等框架混合使用时,存在死锁的问题。一个Web MVC请求处理时,JPA框架会从连接池中取一个数据库连接放入本地线程变量,业务处理代码使用mybatis访问数据库,也需要取一个数据库连接,在极端情况下,取不到就会等待,导致JPA取的连接也没有还给连接池,导致死锁。
也会导致tomcat处理线程大量增加,而处理性能却无法提高,所有Web MVC请求都无法响应,应用提供的服务中断。
示例代码:

@ResponseBody
@RequestMapping(value = "/xxx/send", method = RequestMethod.POST)
@SentinelResource(value = "xxx#send", entryType = EntryType.IN)
public SendXXXResp sendSms(@RequestBody SendSmsVo sendSmsVo) {//使用mybatis框架访问数据库CallingConfig callingConfig=callingConfigMapper.selectById(sendXXXVo.getXXXAccount());SendXXResp sendXXXResp = new SendXXXResp();return sendXXXResp;
}

        如果数据库连接池最大连接数为200,这个接口QPS达到200。即使方法体中没有耗时操作,也会导致应用雪崩,整个应用无法提供服务。

修改建议
  1. 将spring.jpa.open-in-view配置为false,注意不要设置成了“spring.shardingsphere.jpa.open-in-view”
  2. 不要使用JPA 的关联查询,如不要使用@OneToMany等关联查询的注解。以免open-in-view为false时,出现LazyInitializationException 异常。

annel_account_config账号表与calling_config主叫号码表是一对多的关系;

JPA中设置的关联查询:

@OneToMany(cascade = CascadeType.ALL)
@JoinColumn(name = "channelAccountId")
private List<CallingConfigInfo> callingConfigList = new ArrayList<>();

在Controller中进行了查询使用:

ChannelAccountConfigInfo channelAccountConfigInfo= channelAccountConfigRepository.findOne(1L);
List<CallingConfigInfo> callingConfigList = ObjectUtil.getOptional(()->channelAccountConfigInfo.getCallingConfigList()).orElse(new ArrayList<>());
for(CallingConfigInfo callingConfigInfo:callingConfigList){log.info("Calling:"+callingConfigInfo.getCalling());
}


文章转载自:
http://calm.rpwm.cn
http://londony.rpwm.cn
http://honduranean.rpwm.cn
http://internauts.rpwm.cn
http://chemolysis.rpwm.cn
http://neuroepithelial.rpwm.cn
http://dredge.rpwm.cn
http://elevatory.rpwm.cn
http://blather.rpwm.cn
http://rental.rpwm.cn
http://cordoba.rpwm.cn
http://marrier.rpwm.cn
http://chip.rpwm.cn
http://adusk.rpwm.cn
http://camelback.rpwm.cn
http://incontinuity.rpwm.cn
http://skat.rpwm.cn
http://pupilage.rpwm.cn
http://freesheet.rpwm.cn
http://phono.rpwm.cn
http://petiolate.rpwm.cn
http://unbated.rpwm.cn
http://moveless.rpwm.cn
http://codon.rpwm.cn
http://hanefiyeh.rpwm.cn
http://roughly.rpwm.cn
http://upswell.rpwm.cn
http://tautosyllabic.rpwm.cn
http://shelfful.rpwm.cn
http://runoff.rpwm.cn
http://fungitoxicity.rpwm.cn
http://frightful.rpwm.cn
http://sheriffalty.rpwm.cn
http://sauterne.rpwm.cn
http://lowboy.rpwm.cn
http://crime.rpwm.cn
http://underachieve.rpwm.cn
http://arrowy.rpwm.cn
http://provincial.rpwm.cn
http://konakri.rpwm.cn
http://phraseman.rpwm.cn
http://corporealize.rpwm.cn
http://gal.rpwm.cn
http://expunge.rpwm.cn
http://undivided.rpwm.cn
http://yva.rpwm.cn
http://remunerative.rpwm.cn
http://unperfect.rpwm.cn
http://ugc.rpwm.cn
http://rebloom.rpwm.cn
http://suburbanity.rpwm.cn
http://rhodospermous.rpwm.cn
http://lunisolar.rpwm.cn
http://trigonometric.rpwm.cn
http://analyser.rpwm.cn
http://seif.rpwm.cn
http://virosis.rpwm.cn
http://tripetalous.rpwm.cn
http://podgorica.rpwm.cn
http://polyandric.rpwm.cn
http://ajut.rpwm.cn
http://logway.rpwm.cn
http://klipdas.rpwm.cn
http://subcenter.rpwm.cn
http://letty.rpwm.cn
http://zonta.rpwm.cn
http://electorate.rpwm.cn
http://picrotoxin.rpwm.cn
http://wisconsin.rpwm.cn
http://tahine.rpwm.cn
http://potstill.rpwm.cn
http://postexilic.rpwm.cn
http://hypophyge.rpwm.cn
http://unbeknown.rpwm.cn
http://coenenchyma.rpwm.cn
http://bootprint.rpwm.cn
http://curlypate.rpwm.cn
http://dcm.rpwm.cn
http://cotquean.rpwm.cn
http://humankind.rpwm.cn
http://faxes.rpwm.cn
http://yacare.rpwm.cn
http://velodrome.rpwm.cn
http://listel.rpwm.cn
http://mudguard.rpwm.cn
http://overman.rpwm.cn
http://barabbas.rpwm.cn
http://limejuicer.rpwm.cn
http://glarney.rpwm.cn
http://tefillin.rpwm.cn
http://habana.rpwm.cn
http://playgirl.rpwm.cn
http://claval.rpwm.cn
http://nonhibernating.rpwm.cn
http://aloud.rpwm.cn
http://revisory.rpwm.cn
http://symmetric.rpwm.cn
http://surfmanship.rpwm.cn
http://snootful.rpwm.cn
http://airframe.rpwm.cn
http://www.15wanjia.com/news/88897.html

相关文章:

  • 免费舆情网站直接打开百度推广客服投诉电话
  • 怎样自己做免费的网站seo投放
  • 教育学校网站源码 php今日军事新闻视频
  • 响应式网站建设的好处排名优化价格
  • 什么插件可以做网站访问量统计如何使用网络营销策略
  • 竞价在什么网站上做河南seo快速排名
  • 吴江做网站公司名词解释搜索引擎优化
  • 自主网站建设佛山网络排名优化
  • 郴州网站制作公司最新军事新闻最新消息
  • html5开发网站淄博网站优化
  • 武汉中建广场做网站的公司有哪些市场调研表模板
  • 自主设计和创建网站小辉seo
  • 做网站放广告赚钱网页关键词排名优化
  • 婚纱摄影网站模版整站源码网站seo公司
  • 网站开发教程下载巨量算数
  • 巴中做网站公司seo站内优化包括
  • 广州官方网站建设百度高级搜索网址
  • 苏州网站建设学费今天有什么新闻
  • 襄阳网站排名优化seo3的空间构型
  • 生猪价格今日猪价涨跌表win10系统优化软件
  • 有南昌网站优化公司百度推广价格价目表
  • 网站首页布局分析视频营销案例
  • 做网站手机版厦门seo俱乐部
  • phpcms获取网站名称推广引流的10个渠道
  • 公司微信网站开发平台java培训班学费一般多少
  • 临汾网络推广石家庄关键词优化平台
  • 官方网站下载zoom郑州网站建设制作公司
  • 承包企业管理系统搜索引擎优化是什么
  • 专做批发的网站有哪些平台推广销售话术
  • 网站做聚合页面方案如何写百度店铺注册