项目通过Hibernate查询时报出如下错误:

Hibernate Could not obtain transaction-synchronized Session for current thread

解决办法:

在实现类上添加@Transactional注解即可。

Hibernate Could not obtain transaction-synchronized Session for current thread问题处理的更多相关文章

  1. 关于Hibernate Could not obtain transaction-synchronized Session for current thread

    转载自 http://blog.csdn.net/flyjiangs/article/details/51537381 最近几年一直再搞android,最近闲下来了,顺便玩一下web. 整了个最新版本 ...

  2. org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread

    spring与hibernate整合报错 org.hibernate.HibernateException: Could not obtain transaction-synchronized Ses ...

  3. 记一次bug思考过程:HibernateException: Could not obtain transaction-synchronized Session for current thread

    场景:把从客户端提交的任务放到线程池执行 异常:HibernateException: Could not obtain transaction-synchronized Session for cu ...

  4. Hibernate4中使用getCurrentSession报Could not obtain transaction-synchronized Session for current thread

    架个spring4+hibernate4的demo,dao层直接注入的sessionFactory,然后用getCurrentSession方法获取session,然后问题来了,直接报错: Could ...

  5. Could not obtain transaction-synchronized Session for current thread原因及解决方案

            在开发中,碰到到了Could not obtain transaction-synchronized Session for current thread异常,因此特意记录下. 一.问 ...

  6. 关于Could not obtain transaction-synchronized Session for current thread 这个异常。

    Could not obtain transaction-synchronized Session for current thread 这个异常之前非常让我头大.对于网上的各种说法都试了一下反正都不 ...

  7. Could not obtain transaction-synchronized Session for current thread 错误的解决方法!

    BsTable bsTable = new BsTable(); // String time = request.getParameter("date"); String tim ...

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

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

  9. Hibernate 的Configuration、sessionFactory和session和transaction对象解释

    1.Configuration对象: Configuration conf=new Configuration(); conf.configure(); 1.1 到 src下面找到名称hibernat ...

随机推荐

  1. LeetCode(28)题解:Implement strStr()

    https://leetcode.com/problems/implement-strstr/ 题目: Implement strStr(). Returns the index of the fir ...

  2. mongo 原理 Replica Set Oplog

    [客户的写请求全部发送至主节点] Primary. The primary receives all write operations. Secondaries. Secondaries replic ...

  3. php网站前台utf-8格式有时会出现莫名其妙的空白行,重新保存下编码格式就可以了

    php网站前台utf-8格式有时会出现莫名其妙的空白行,重新保存下编码格式就可以了.

  4. jquery1.9是最后支持IE678

    bootstrap  需要 jquery 1.9.1或更高 jquery1.9是最后支持IE678

  5. Windows 7 繁体中文MSDN原版

    Win7 SP1 64位旗舰版繁体版ISO镜像(香港):文件名:hk_windows_7_enterprise_with_sp1_x64_dvd_620688.isoSHA1:82D59B099333 ...

  6. linux下lk和kernel层通信方式[2]

    U-Boot与Linux内核的交互 说明:本文所使用的U-Boot的版本是1.1.6,平台是S3C2440. 目录 一.简介 1.1标记列表二.设置标记存放的地址 2.1相关的结构体定义 2.2标记存 ...

  7. YTU 2209: 建立链表(线性表)

    2209: 建立链表(线性表) 时间限制: 1 Sec  内存限制: 128 MB 提交: 282  解决: 185 题目描述 (线性表)设键盘输入n个英语单词,输入格式为n, w1, w2, -,w ...

  8. oracle监听器启动,实例启动

    1,su - oracle登录oracle用户 2,sqlplus / as sysdba登录oracle 3,show parameter service_names; 若正常输出servicena ...

  9. Java 绘制环形的文字 (Circle Text Demo)

    1. [代码]CircleTextDemo.java     import java.awt.*;import java.awt.event.*;import java.awt.geom.*; /** ...

  10. codeforces A. Kitahara Haruki's Gift 解题报告

    题目链接:http://codeforces.com/problemset/problem/433/A 题目意思:给定 n 个只由100和200组成的数,问能不能分成均等的两份. 题目其实不难,要考虑 ...