pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    1. <tfoot id='ItxYC'></tfoot>

      <small id='ItxYC'></small><noframes id='ItxYC'>

    2. <legend id='ItxYC'><style id='ItxYC'><dir id='ItxYC'><q id='ItxYC'></q></dir></style></legend>
    3. <i id='ItxYC'><tr id='ItxYC'><dt id='ItxYC'><q id='ItxYC'><span id='ItxYC'><b id='ItxYC'><form id='ItxYC'><ins id='ItxYC'></ins><ul id='ItxYC'></ul><sub id='ItxYC'></sub></form><legend id='ItxYC'></legend><bdo id='ItxYC'><pre id='ItxYC'><center id='ItxYC'></center></pre></bdo></b><th id='ItxYC'></th></span></q></dt></tr></i><div class="9lxrjjx" id='ItxYC'><tfoot id='ItxYC'></tfoot><dl id='ItxYC'><fieldset id='ItxYC'></fieldset></dl></div>
        <bdo id='ItxYC'></bdo><ul id='ItxYC'></ul>

        OpenJPA 查詢第二次失敗(可能是因為字節數組參數

        OpenJPA query fails second time (possibly because of byte array parameter)(OpenJPA 查詢第二次失敗(可能是因為字節數組參數))
      1. <i id='GZWoQ'><tr id='GZWoQ'><dt id='GZWoQ'><q id='GZWoQ'><span id='GZWoQ'><b id='GZWoQ'><form id='GZWoQ'><ins id='GZWoQ'></ins><ul id='GZWoQ'></ul><sub id='GZWoQ'></sub></form><legend id='GZWoQ'></legend><bdo id='GZWoQ'><pre id='GZWoQ'><center id='GZWoQ'></center></pre></bdo></b><th id='GZWoQ'></th></span></q></dt></tr></i><div class="vlxzxnt" id='GZWoQ'><tfoot id='GZWoQ'></tfoot><dl id='GZWoQ'><fieldset id='GZWoQ'></fieldset></dl></div>
          <tbody id='GZWoQ'></tbody>
        <tfoot id='GZWoQ'></tfoot>

            <legend id='GZWoQ'><style id='GZWoQ'><dir id='GZWoQ'><q id='GZWoQ'></q></dir></style></legend>
              <bdo id='GZWoQ'></bdo><ul id='GZWoQ'></ul>

                • <small id='GZWoQ'></small><noframes id='GZWoQ'>

                  本文介紹了OpenJPA 查詢第二次失敗(可能是因為字節數組參數)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有以下 OpenJPA 查詢(通過 db2 數據庫):

                  I have following OpenJPA query (over db2 database):

                  Select number from Number number where number.uuid = :uuid
                  

                  列 uuid 定義為 VARCHAR FOR BIT DATA(16).在實體中它表示為 byte[] 類型字段.

                  Column uuid defined as VARCHAR FOR BIT DATA(16). In entity it represented as byte[] type field.

                  問題是,當我第一次使用該查詢調用方法時(在 WebSphere 服務器啟動后)它工作正常.后續調用會導致錯誤(我什至啟用了跟蹤日志,看看錯誤在哪里)

                  The problem is that when I call method with that query first time(after WebSphere server is up) it works fine. Consequential calls result in error (I even enabled trace log see where the error is)

                  1st time:> query is running, everything's ok
                  [11/25/15 13:27:03:803 IST] 0000001d Query         3   openjpa.Query: Trace: Executing query: [Select n from Number n where n.uuid = :uuid] with parameters: ?
                  [11/25/15 13:27:04:199 IST] 0000001d jdbc_SQL      3   openjpa.jdbc.SQL: Trace: <t 507109353, conn 1755254015> executing prepstmnt -1123134307 SELECT t0.NUMBER_ID, t0.comment, t0.EMPLOYEE_ID, t0.number, t0.RANGE_ID, t0.status, t0.uuid FROM PHONES.Number t0 WHERE (t0.uuid = ?)  [params=?]
                  [11/25/15 13:27:04:249 IST] 0000001d jdbc_SQL      3   openjpa.jdbc.SQL: Trace: <t 507109353, conn 1755254015> [50 ms] spent
                  [11/25/15 13:27:04:251 IST] 0000001d jdbc_JDBC     3   openjpa.jdbc.JDBC: Trace: <t 507109353, conn 1755254015> [0 ms] close
                  2nd time:>
                  [11/25/15 13:27:09:068 IST] 0000001d Query         3   openjpa.Query: Trace: Executing query: [Select n from Number n where n.uuid = :uuid] with parameters: ?
                  [11/25/15 13:27:09:556 IST] 0000001d BusinessExcep E   CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "approve" on bean "BeanId(PhoneAllocationEAR#PhoneAllocationEJB.jar#RangeProvider, null)". Exception data: <openjpa-2.1.2-SNAPSHOT-r422266:1548248 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Failed to execute query "Select n from Number n where n.uuid = :uuid". Check the query syntax for correctness. See nested exception for details.
                  

                  這是嵌套異常:

                  Caused by: java.lang.NullPointerException
                  at org.apache.openjpa.jdbc.sql.DB2Dictionary.setBytes(DB2Dictionary.java:1037)
                  at org.apache.openjpa.jdbc.sql.DBDictionary.setUnknown(DBDictionary.java:1481)
                  at org.apache.openjpa.jdbc.sql.DBDictionary.setUnknown(DBDictionary.java:1429)
                  at org.apache.openjpa.jdbc.kernel.PreparedSQLStoreQuery$PreparedSQLExecutor.executeQuery(PreparedSQLStoreQuery.java:114)
                  at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1005)
                  at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
                  ... 86 more 
                  

                  這是出現異常的代碼:

                  public String findByUUID(UUID uuid) {
                  
                      TypedQuery<Number> query = em.createQuery("Select n from Number n where n.uuid = :uuid", Number.class);
                      ByteBuffer bb = ByteBuffer.allocate(16);
                      bb.putLong(uuid.getMostSignificantBits());
                      bb.putLong(uuid.getLeastSignificantBits());
                      byte[] parameter = bb.array();
                  
                      query.setParameter("uuid", parameter);
                  
                      List<Number> result = new ArrayList<Number>(query.getResultList());
                      return result;
                  }
                  

                  *附加信息:如果我從列描述中刪除 BIT DATA - 我會收到另一個錯誤:

                  *additional info: If I drop BIT DATA from column description - I get another error :

                  nested exception is: javax.ejb.EJBException: See nested exception; nested exception is: org.apache.openjpa.persistence.PersistenceException: The value of input variable, expression or parameter number "1" cannot be used because of its data type.. SQLCODE=-301, SQLSTATE=07006, DRIVER=4.14.113 {prepstmnt 2039708348 SELECT t0.NUMBER_ID, t0.comment, t0.EMPLOYEE_ID, t0.number, t0.RANGE_ID, t0.status, t0.uuid FROM PHONES.Number t0 WHERE (t0.uuid = ?) [params=?]} [code=-301, state=07006]SQLCA OUTPUT[Errp=SQLRI4A4, Errd=-2145779603, 0, 0, 0, -3700, 0] The value of input variable, expression or parameter number "1" cannot be used because of its data type.. SQLCODE=-301, SQLSTATE=07006, DRIVER=4.14.113 FailedObject: Select n from Number n where n.uuid = :uuid [java.lang.String]
                  

                  我是通過查看 openJPA 但同時它對我沒有幫助.

                  I learned it from looking at source of openJPA but it doesn't help me meanwhile.

                  推薦答案

                  嘗試禁用準備好的查詢緩存.眾所周知,它非常有問題.如果需要,您可以搜索 OpenJPA JIRA 以查找詳細信息.

                  Try to disable the prepared query cache. It's known to be quite buggy. You can search the OpenJPA JIRA to find details if you want.

                  <property name="openjpa.jdbc.QuerySQLCache" value="true(EnableStatistics=true)">

                  這篇關于OpenJPA 查詢第二次失敗(可能是因為字節數組參數)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)

                      <small id='tYEhd'></small><noframes id='tYEhd'>

                      <i id='tYEhd'><tr id='tYEhd'><dt id='tYEhd'><q id='tYEhd'><span id='tYEhd'><b id='tYEhd'><form id='tYEhd'><ins id='tYEhd'></ins><ul id='tYEhd'></ul><sub id='tYEhd'></sub></form><legend id='tYEhd'></legend><bdo id='tYEhd'><pre id='tYEhd'><center id='tYEhd'></center></pre></bdo></b><th id='tYEhd'></th></span></q></dt></tr></i><div class="rt7t1xp" id='tYEhd'><tfoot id='tYEhd'></tfoot><dl id='tYEhd'><fieldset id='tYEhd'></fieldset></dl></div>

                    • <tfoot id='tYEhd'></tfoot>
                          • <bdo id='tYEhd'></bdo><ul id='tYEhd'></ul>
                          • <legend id='tYEhd'><style id='tYEhd'><dir id='tYEhd'><q id='tYEhd'></q></dir></style></legend>
                              <tbody id='tYEhd'></tbody>
                            主站蜘蛛池模板: 成都租车_成都租车公司_成都租车网_众行宝| 马尔表面粗糙度仪-MAHR-T500Hommel-Mitutoyo粗糙度仪-笃挚仪器 | 点焊机-缝焊机-闪光对焊机-电阻焊设备生产厂家-上海骏腾发智能设备有限公司 | DAIKIN电磁阀-意大利ATOS电磁阀-上海乾拓贸易有限公司 | 气动隔膜泵-电动隔膜泵-循环热水泵-液下排污/螺杆/管道/化工泵「厂家」浙江绿邦 | 底部填充胶_电子封装胶_芯片封装胶_芯片底部填充胶厂家-东莞汉思新材料 | 金属管浮子流量计_金属转子流量计厂家-淮安润中仪表科技有限公司 | 登车桥动力单元-非标液压泵站-非标液压系统-深圳市三好科技有限公司 | 酒吧霸屏软件_酒吧霸屏系统,酒吧微上墙,夜场霸屏软件,酒吧点歌软件,酒吧互动游戏,酒吧大屏幕软件系统下载 | 打包钢带,铁皮打包带,烤蓝打包带-高密市金和金属制品厂 | 色油机-色母机-失重|称重式混料机-称重机-米重机-拌料机-[东莞同锐机械]精密计量科技制造商 | 定硫仪,量热仪,工业分析仪,马弗炉,煤炭化验设备厂家,煤质化验仪器,焦炭化验设备鹤壁大德煤质工业分析仪,氟氯测定仪 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 热处理温控箱,热处理控制箱厂家-吴江市兴达电热设备厂 | EDLC超级法拉电容器_LIC锂离子超级电容_超级电容模组_软包单体电容电池_轴向薄膜电力电容器_深圳佳名兴电容有限公司_JMX专注中高端品牌电容生产厂家 | 焊锡丝|焊锡条|无铅锡条|无铅锡丝|无铅焊锡线|低温锡膏-深圳市川崎锡业科技有限公司 | ERP企业管理系统永久免费版_在线ERP系统_OA办公_云版软件官网 | 北京网络营销推广_百度SEO搜索引擎优化公司_网站排名优化_谷歌SEO - 北京卓立海创信息技术有限公司 | 高硼硅玻璃|水位计玻璃板|光学三棱镜-邯郸奥维玻璃科技有限公司 高温高压釜(氢化反应釜)百科 | 杜甫仪器官网|实验室平行反应器|升降水浴锅|台式低温循环泵 | 锌合金压铸-铝合金压铸厂-压铸模具-冷挤压-誉格精密压铸 | 通风天窗,通风气楼,屋顶通风天窗,屋顶通风天窗公司 | 不干胶标签-不干胶贴纸-不干胶标签定制-不干胶标签印刷厂-弗雷曼纸业(苏州)有限公司 | 闭端端子|弹簧螺式接线头|防水接线头|插线式接线头|端子台|电源线扣+护线套|印刷电路板型端子台|金笔电子代理商-上海拓胜电气有限公司 | 车间除尘设备,VOCs废气处理,工业涂装流水线,伸缩式喷漆房,自动喷砂房,沸石转轮浓缩吸附,机器人喷粉线-山东创杰智慧 | 诺冠气动元件,诺冠电磁阀,海隆防爆阀,norgren气缸-山东锦隆自动化科技有限公司 | 广州办公室设计,办公室装修,写字楼设计,办公室装修公司_德科 | 二氧化碳/活性炭投加系统,次氯酸钠发生器,紫外线消毒设备|广州新奥 | 低气压试验箱_高低温低气压试验箱_低气压实验箱 |林频试验设备品牌 | 专业生物有机肥造粒机,粉状有机肥生产线,槽式翻堆机厂家-郑州华之强重工科技有限公司 | 手持式浮游菌采样器-全排二级生物安全柜-浙江孚夏医疗科技有限公司 | 手板_手板模型制作_cnc手板加工厂-东莞天泓 | 长信科技产业园官网_西安厂房_陕西标准工业厂房 | 环保袋,无纺布袋,无纺布打孔袋,保温袋,环保袋定制,环保袋厂家,环雅包装-十七年环保袋定制厂家 | 首页-浙江橙树网络技术有限公司 石磨面粉机|石磨面粉机械|石磨面粉机组|石磨面粉成套设备-河南成立粮油机械有限公司 | 周口市风机厂,周鼓风机,河南省周口市风机厂 | 本安接线盒-本安电路用接线盒-本安分线盒-矿用电话接线盒-JHH生产厂家-宁波龙亿电子科技有限公司 | 船用烟火信号弹-CCS防汛救生圈-船用救生抛绳器(海威救生设备) | 诚暄电子公司首页-线路板打样,pcb线路板打样加工制作厂家 | 伟秀电气有限公司-10kv高低压开关柜-高低压配电柜-中置柜-充气柜-欧式箱变-高压真空断路器厂家 | 3d可视化建模_三维展示_产品3d互动数字营销_三维动画制作_3D虚拟商城 【商迪3D】三维展示服务商 广东健伦体育发展有限公司-体育工程配套及销售运动器材的体育用品服务商 |