当前版本的Javers支持MongoDB事务: If you use Spring Boot, then after declaring the MongoTransactionManager as described here: https://www.baeldung.com/spring-data-mongodb-transactions#mongodb-configuration Javers will pick it up automatically. If you are not using Spring Boot, then you can configure Javers as described here: https://javers.org/documentation/spring-integration/#mongo-transactions. 请注意,如果您配置了Javes将数据写入单独的数据库,那么您将无法轻松地配置事务管理。
2条答案
按热度按时间u7up0aaq1#
当前版本的Javers支持MongoDB事务:
If you use Spring Boot, then after declaring the MongoTransactionManager as described here: https://www.baeldung.com/spring-data-mongodb-transactions#mongodb-configuration Javers will pick it up automatically.
If you are not using Spring Boot, then you can configure Javers as described here: https://javers.org/documentation/spring-integration/#mongo-transactions.
请注意,如果您配置了Javes将数据写入单独的数据库,那么您将无法轻松地配置事务管理。
gudnpqoy2#
在MongoDB中没有事务。你所拥有的只是文档级的原子写(参见https://docs.mongodb.com/manual/core/write-operations-atomicity/)。JaVers没有在应用程序端实现任何类型的“多文档事务”。
如果需要类似SQL的事务,请选择集成了JPA实体管理器的JaversSqlRepository(请参见https://javers.org/documentation/spring-integration/#jpa-entity-manager-integration)。