zoukankan      html  css  js  c++  java
  • 关于Pre-bound JDBC Connection found! HibernateTransactionManager does not 异常小结

    昨天帮女朋友配置ssh框架的多数据源, 本以为对此已经很熟悉,配置完其他的错倒是还能接受,调了一下就好了。  唯独 Pre-bound JDBC Connection found! HibernateTransactionManager does not  这个异常着实浪费了我些时间。

    也百度看到网上说是, 因为在代码中同时使用了jdbc和spring管理的hibernate 两种事务导致的,所以一开始重心放到了代码中,可是检查了N次代码没有问题啊, 最后实在不行找一个配置好的开始比对,试了几次才发现原来是配置事务的xml文件的头部不对,替换下面这个就好了。    原因:之前的配置少了schema/tx.xsd 和schma/tx/spring-tx.xsd和 schema/aop/spring-aop.xsd  来声明使用的事务。  这里记录一下希望可以帮到有同样异常的小伙伴。

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:aop="http://www.springframework.org/schema/aop" xmlns="http://www.springframework.org/schema/beans"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"
    >
  • 相关阅读:
    (Go)11.九九乘法表示例
    (Go)10.流程控制示例
    (Go)09.指针赋值修改示例
    (Go)08.time示例
    (Go)07.strings与strconv的示例
    (Go)07.Go语言中strings和strconv包示例代码详解02
    (Go)06. Printf格式化输出、Scanf格式化输入详解
    kafka参数在线修改
    vs code golang代码自动补全
    JVM 方法区
  • 原文地址:https://www.cnblogs.com/qiaoyutao/p/10978438.html
Copyright © 2011-2022 走看看