今天客户发来的错误,是SSH框架做的项目,是用户在登陆时候出现的错误,但刷新之后就没问题。

提示错误:Could not open Hibernate Session for transaction。大概意思就是数据库连接超时。

解决方法如下:

在spring的配置文件中添加如下配置

给sessionFactory的bean添加如下配置

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="hibernateProperties">
  <props>
        <prop key="hibernate.autoReconnect">true</prop>
  </props>
  </property>
  </bean>

即可

Hibernage错误:Could not open Hibernate Session for transaction的更多相关文章

  1. org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open con

    org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session f ...

  2. Could not open Hibernate Session for transaction;

    javax.servlet.ServletException: org.springframework.transaction.CannotCreateTransactionException: Co ...

  3. SSH项目过一段时间之后再访问会报一次Could not open Hibernate session for transaction 异常,Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlyi,再重新方法即可访问成功(通常出现在过了一晚之后再去访问系统)

    前端时间到客户那去进行项目的上线测试,将项目部署好之后,运行都是正常的,可是每到了第二天早上访问的时候,就会报一个Could not open Hibernate session for transa ...

  4. 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext

    我使用的是5.2.8的hibernate的jar包,运行的时候却报错Could not open Hibernate Session for transaction; nested exception ...

  5. HTTP Status 500 - Could not open Hibernate Session for transaction;

    错误原因: mysql数据库没有连接上 我们来启动mysql 方法1: 管理员身份运行 cmd 输入:  net start mysql 方法2: Windows + R 运行 services.ms ...

  6. 解决Exception:Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext

    原因是配置文件中 <bean id="transactionManager" class="org.springframework.orm.hibernate4.H ...

  7. Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep linux下mysql修改连接超时wait_timeout修改后就ok了

    Linux下mysql修改连接超时wait_timeout 1,首先: show variables like '%timeout%': 显示结果: +------------------------ ...

  8. Use Spring transaction to simplify Hibernate session management

    Spring对Hibernate有很好的支持    DataSource ->SessionFactory-> HibernateTranscationManagerHibernate中通 ...

  9. [原创]java WEB学习笔记77:Hibernate学习之路---Hibernate 版本 helloword 与 解析,.环境搭建,hibernate.cfg.xml文件及参数说明,持久化类,对象-关系映射文件.hbm.xml,Hibernate API (Configuration 类,SessionFactory 接口,Session 接口,Transaction(事务))

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

随机推荐

  1. LinkedList源码剖析

    LinkedList简介 LinkedList是基于双向循环链表(从源码中可以很容易看出)实现的,除了可以当做链表来操作外,它还可以当做栈.队列和双端队列来使用. LinkedList同样是非线程安全 ...

  2. Excel-DNA项目只用1个文件实现Ribbon CustomUI和CustomTaskpane定制【C#版】

    Excel-DNA项目中的自定义功能区和自定义任务窗格需要用到各种命名空间.添加所需文件,才能实现.后来我发现可以把所有代码都写在Class1.cs这个默认文件中. 大家可以在Visual Studi ...

  3. BadRequestException

    package me.zhengjie.common.exception; import lombok.Getter; import org.springframework.http.HttpStat ...

  4. java 变量分类

    转:https://blog.csdn.net/suneqing/article/details/37909811 1.按被声明的位置划分 局部变量:方法和语句块内定义的的变量.(在定义局部变量时,必 ...

  5. 关闭”xx程序已停止工作”提示窗口

    运行注册表编辑器,依次定位到HKEY_CURRENT_USER\Software\Microsoft\Windows\WindowsError Reporting,在右侧窗口中找到并双击打开Donts ...

  6. Linux下MongoDB的部署

    一.MongoDB的下载解压 MongoDB在linux是免编译安装的,直接解压就可以用. # 解压 tar -zxvf mongodb-linux-x86_64-3.0.6.tgz # 将解压包拷贝 ...

  7. 用artifactory搭建maven2内部服务器

    访问http://www.jfrog.org/sites/jfrog/index.html 下载最新的zip包(内置jetty) 下载和解压artifactory.目录结构如下: 这些目录是: bac ...

  8. Beautiful Soup的用法(五):select的使用

    原文地址:http://www.bugingcode.com/blog/beautiful_soup_select.html select 的功能跟find和find_all 一样用来选取特定的标签, ...

  9. Find a way (广度优先搜索)

    题目: Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one ...

  10. 自动化移动安全渗透测试框架:Mobile Security Framework

    自动化移动安全渗透测试框架:Mobile Security Framework 译/Sphinx  测试开发社区  7月3日 Mobile Security Framework (移动安全框架) 是一 ...