0
私は永続的なSpring JPAエンティティマネージャを使用するアプリケーションで作業しています。当社の実動データベースは2台のサーバー上にあり、時にはどちらが稼働しているか、どのバックアップがバックアップであるかについて役割を入れ替えることがあります。エンティティ管理者はロールスワップに問題がありますか?もしそうなら、それを処理する最善の方法は何ですか?Spring JPA永続エンティティマネージャを使用するときにロールスワップを処理する方法は?
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@Repository
public class CarolJpaDao
{
@PersistenceContext
private EntityManager entityManager;
ポンポン:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>