zoukankan      html  css  js  c++  java
  • 记一次伪*sql查询结果不一致的

    调试代码发现,两个操作最后都会调用同一个方法。传入的参数一致,查询结果却不一致。

    直接说问题原因:我的两个操作是aop环绕通知先拿到传入参数以后,校验是否需要往另一张表中插入数据。第二种调用核心逻辑

    Object retVal = pjp.proceed();

     后,才会把checkStatus置为1,所以在核心逻辑前查询的结果数是0。

    两次分别打印的sql,和入参,以及结果

    [DEBUG] [2017-10-25 20:48:27,888] [http-nio-8080-exec-1] [] - [==>  Preparing: select id, name, code, programCode, seriesCode, 
    seriesName, showid, type, source, sourceID, cpName, cpCode, status, checkStatus, checkContent, downloadStatus, transcodeStatus,
    overallBitRate, duration, bitRateMode, filePath, fileSize, fileFormat, playURL, videoFormat, videoBitRate, width, height, frameRate,
    bitDepth, audioFormat, audioBitRate, samplingRate, scanType, md5, priority, cpContentID, cdnStatus, cdnDesc, domainCode, domainName,
    offlineReason, checkTime, createTime, updateTime,transcodeId,videoType,isCompleted,completeReason from t_movie where type=0 and
    programCode=? and checkStatus=1 and downloadStatus=2 ] [DEBUG] [2017-10-25 20:48:27,889] [http-nio-8080-exec-1] [] - [==> Parameters: 23000022017102510572300001(String)] [DEBUG] [2017-10-25 20:48:27,892] [http-nio-8080-exec-1] [] - [
    <== Total: 1]
    [DEBUG] [2017-10-25 20:50:08,957] [http-nio-8080-exec-9] [] - [==>  Preparing: select id, name, code, programCode, seriesCode, 
    seriesName, showid, type, source, sourceID, cpName, cpCode, status, checkStatus, checkContent, downloadStatus, transcodeStatus,
    overallBitRate, duration, bitRateMode, filePath, fileSize, fileFormat, playURL, videoFormat, videoBitRate, width, height, frameRate,
    bitDepth, audioFormat, audioBitRate, samplingRate, scanType, md5, priority, cpContentID, cdnStatus, cdnDesc, domainCode, domainName,
    offlineReason, checkTime, createTime, updateTime,transcodeId,videoType,isCompleted,completeReason from t_movie where type=0 and
    programCode=? and checkStatus=1 and downloadStatus=2 ] [DEBUG] [2017-10-25 20:50:08,958] [http-nio-8080-exec-9] [] - [==> Parameters: 23000022017102510572300001(String)] [DEBUG] [2017-10-25 20:50:08,960] [http-nio-8080-exec-9] [] - [
    <== Total: 0]
  • 相关阅读:
    FJoi2017 1月21日模拟赛 comparison(平衡树+thita重构)
    juruo的刷题&博文祭
    [bzoj4247][挂饰] (动规+排序)
    FJoi2017 1月20日模拟赛 直线斯坦纳树(暴力+最小生成树+骗分+人工构造+随机乱搞)
    FJoi2017 1月20日模拟赛 交错和(等差数列+rmq)
    FJoi2017 1月20日模拟赛 恐狼后卫(口糊动规)
    【spoj 5971】lcmsum
    【bzoj 4025 改编版】graph
    【CF 718C】fibonacci
    【CF 482E】ELCA
  • 原文地址:https://www.cnblogs.com/yt975548/p/7735584.html
Copyright © 2011-2022 走看看