I am using a Spring Data (JPA) repository to take care of CRUD boilerplate.
I define my repository interface like so:
import org.springframework.data.repository.CrudRepository;
public interface FooRepository extends CrudRepository<Foo, Long>
{
public Foo findByXAndYAndZ(X x, Y y, Z z);
}
Spring then auto-magically generates me an implementation of said interface. What we get back is a proxy, but I believe that eventually we get down to a org.springframework.data.jpa.repository.support.SimpleJpaRepository
.
A JdkDynamicAopProxy
is thread-safe if the underlying target class is thread-safe. The question therefore is: is SimpleJpaRepository
thread safe?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…