0

我試圖使用Spring Data JPA,Neo4J和MongoDB設置Spring Boot應用程序。目標是能夠在每個數據存儲中保存不同的實體,以及使用跨商店實體。在Spring Boot中使用多個嵌入式數據存儲

該項目似乎與每個單獨的店很好地工作,但節省了JPA實體引發此異常:如果我刪除所有的Neo4j和MongoDB相關的代碼

org.springframework.dao.InvalidDataAccessApiUsageException: No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call; nested exception is javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call 

此異常不提高。

下面是該項目的鏈接在GitHub上:

GitHub

回答

2

我設法得到它的工作通過使用this項目的配置。

它看起來像我不得不添加一個「transactionManagerRef」屬性到@EnableJpaRepositories註釋,多一點配置轉換管理器,並修改一些依賴關係。

+0

github存儲庫已更新。 – Raphael

相關問題