参考地址:
http://docs.spring.io/spring-data/jpa/docs/current/api/org/springframework/data/jpa/repository/config/EnableJpaRepositories.html#enableDefaultTransactions--
public abstract boolean enableDefaultTransactions
Configures whether to enable default transactions for Spring Data JPA repositories. Defaults to true. If disabled, repositories must be used behind a facade that's configuring transactions (e.g. using Spring's annotation driven transaction facilities) or repository methods have to be used to demarcate transactions.
Returns:
whether to enable default transactions, defaults to true.
Default:
true
原来是在spring配置文件中关闭了jpa默认的事务管理机制
<jpa:repositories base-package="com.xx.order"
enable-default-transactions="false" />

 需要手动开启,所以,用spring的annotation在方法或类里面开启------------------(用@Transactional)

No transactional EntityManager available; nested exception is javax.persistence.TransactionRequiredException: No transactional EntityManager available的更多相关文章

  1. [Spring Data JPA问题]Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException

    JPQL如下: @Modifying(clearAutomatically = true) @Query("UPDATE SyncTestFromTKDO SET stuAns = '' w ...

  2. 报错:org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query

    service实现类上没有加@transaction 事务注解

  3. Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Cannot open connection

    Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceE ...

  4. 使用JPA保存对象时报nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOnly错误

    使用JPA保存对象时报nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOn ...

  5. javax.persistence.TransactionRequiredException: No transactional EntityManager available

    在操作中加上@Transcational注解,一般是用于修改或者删除操作.

  6. Caused by: javax.persistence.TransactionRequiredException: Executing an update/delete query

    org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested ...

  7. org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is javax.xml.strea

    xfire使用中出现故障: 1. [2014-04-16 14:51:07.564]-[ERROR] org.apache.struts2.dispatcher.Dispatcher Exceptio ...

  8. nested exception is javax.management.InstanceAlreadyExistsException: webservice:name=statFilter,type=StatFilter

    Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [ ...

  9. javax.persistence.TransactionRequiredException: Executing an update/delete query

    最近在springboot中整合jpa的时候碰到一个异常,异常如下 javax.persistence.TransactionRequiredException: Executing an updat ...

随机推荐

  1. Java中正数与负数操作>>、>>>的区别

    以下为个人理解,有不对的地方请提出 Java中,>>.>>>都是在数字的二进制的补码中进行的 正数的补码为本身 如33的二进制表示为 00000000 00000000 ...

  2. <转>Oracle Stream Replication技术

    Stream 是Oracle 的消息队列(也叫Oracle Advanced Queue)技术的一种扩展应用. Oracle 的消息队列是通过发布/订阅的方式来解决事件管理.流复制(Stream re ...

  3. CSDN开源夏令营 百度数据可视化实践 ECharts(8)

    (1)前言 首先谢谢林峰老师,继续接着第七篇提到的内容.CSS布局确实非常累,感觉不好看了就的调整,总的看起来的高大上嘛.好了废话不再多说.今天主要就先解说一个页面的内容,对于CSS布局后面讲会具体的 ...

  4. 远程调试 Weinre

    什么是远程调试? 说白了,就是可以通过PC端[F12开发者工具]查看并调试移动端的页面内容,如html.css.js.Network资源等. 重要的事情说三遍:weinre所占有的端口不需要和监听页面 ...

  5. SSH整合简单例子

    说明:简单SSH整合,struts版本2.3.32,spring版本3.2.9,hibernate版本3.6.10 一.开发步骤 1 引jar包,创建用户library.使用的包和之前博文相同,可以参 ...

  6. rpm | yum 安装软件包时key过期

    1.问题: yum -y install docker-io Loaded plugins: fastestmirror, refresh-packagekit, security Setting u ...

  7. ZooKeeperEclipse 插件

    插件地址:ZooKeeperEclipse  http://www.massedynamic.org/eclipse/updates/ 安装ZooKeeperEclipse插件步骤如下: Step 1 ...

  8. c#动态类型

    class Program { static void Main(string[] args) { dynamic test = new ExpandoObject(); test.Name = &q ...

  9. 【项目总结】:怎样做一个牛逼的Team leader?

    随着ITOO高校云平台3.1项目的结束,我们各种各样的总结也被提上了日程. Java版本号的全部开发者和Donet版本号的全部开发者坐在一起进行了关于项目开发管理的头脑风暴,尽管我仅仅是Donet开发 ...

  10. HDU 4969 Just a Joke(积分)

    HDU 4969 Just a Joke pid=4969" target="_blank" style="">题目链接 推公式,r′=dr/d ...