我正在尝试加载一些只读的实体,我注意到我有一些选项可以这样做,比如@Immutable和在查询中也是只读的。 getEntityManager().createQuery("SELECT p FROM Post p").setHint(QueryHints.READ_ONLY, true).getResultList(); Query query = session.createQuery("SELECT p FROM Post p");
query.setReadOn
我在Spring项目中使用Hibernate搜索5.11.5。对于搜索,我使用投影,因此理论上不需要公开事务。但是,如果删除@Transactional注释并调用Search.getFullTextEntityManager(em),则会得到异常 at org.springframework.orm.jpa.SharedEntityManagerCreator$Prox
11:13:26.101 INFO 9572 --- [nio-8081-exec-8] c.u.r.s.AgentCollectorServiceImpl : Could not open JPAadditionalProperties() { properties.setProperty("hibernate.dialectfound for list " + reportIdsList);
我有一种服务方法public void doSomething() { anotherService.doThing();}@Transactional(propagation = REQUIRES_NEW, noRollbackFor = RuntimeException.classTransaction silently rolled back because it has been marked as ro