在同一個Environment實例中是否可以使用PersistentEntityStore和一個或多個普通Store實例?我希望能夠使用涵蓋這種組合變化的交易。 我發現潛在的商店名稱衝突,我不得不避免。還要別的嗎?在同一個Xodus環境中混合存儲
1
A
回答
0
在單個事務中可以混合使用不同API層的代碼。唯一的要求是不同API所觸及的數據應該被隔離,應該使用不相交的名稱集Stores
。
PersistentEntityStore
使用的Stores
是什麼名稱?任何PersistentEntityStore
都有其自己的唯一名稱和所有Stores
的名稱,它們表示實體存儲到鍵/值層的映射,從"${PersistentEntityStore name}."
開始,因爲它在source code中指定。
另一個問題是API對於這種方法並不完整。經過StoreTransaction
是對PersistentEntityStore
創建的,它應該被強制轉換爲PersistentStoreTransaction
爲了調用PersistentStoreTransaction#getEnvironmentTransaction()
爲獲得潛在交易:
final StoreTransaction txn = entityStore.beginTransaction();
// here is underlying Transaction instance:
final Transaction envTxn = ((PersistentStoreTransaction) txn).getEnvironmentTransaction();
相關問題
- 1. 混合環境中的NServiceBus
- 2. Symfony2混合不同的環境
- 3. 如何在混合環境中
- 4. 混合開發環境
- 5. 混合環境中的git crlf配置
- 6. 在烏龜中混合存儲庫
- 7. 如何在生產環境中存儲不同的文檔?
- 8. Git - 如何將兩個存儲庫混合在一起
- 9. 混帳:結合不同的儲存庫到一個存儲庫具有不同的分支
- 10. golang環境變量存儲在哪裏?
- 11. 在混合租戶環境中生成EntityManager上下文
- 12. 如何在混合的Apache和Tomcat環境中堅持會話
- 13. 無法在混合VS環境中正確處理路由
- 14. 在Linux中使用LD_PRELOAD混合64位/ 32位環境
- 15. Android的境界:在RealmObject中存儲一個非RealmObject一個
- 16. getElementById在一個環境中工作,但不在另一個環境中
- 17. Maven:如何在多個環境中組合一個包
- 18. Laravel混合.copy在同一目錄中?
- 19. 兩個循環混合
- 20. 在閃存中混合多個聲音
- 21. 檢測混合環境中的內存泄漏(託管非託管)
- 22. 如何混合環境和非環境打字稿定義文件
- 23. 在同一個面板中混合多個數據源
- 24. 當在另一個環境
- 25. 如何在Git和Vault複合環境存儲庫中使用Spring Cloud Config?
- 26. 做一個環境變量生存ENDLOCAL
- 27. 混合.NET開發環境中的非託管x64程序集
- 28. 混合http/https環境中的AspNet.Security.OpenIdConnect.Server(ASP.NET vNext)權威配置
- 29. Sessionstate服務器(webfarm)環境中,用戶會話混合起來
- 30. 混合語言環境中的自定義日誌記錄