Not sure if "scope" is here.
I use Spring to manage JPA transactions (with the Hibernate submenu). My database pre-transaction method is confidential, but since you can set @Transactional in a class or on a public method
Since this mechanism is based on proxy servers, only "external" method calls arriving through the proxy server will be intercepted. This means that "self-start", i.e. A method in the target that calls some other method of the target will not result in an actual transaction at run time, even if the called method is marked with @Transactional!
I set the class public entry point as @Transactional.
@Transactional
public void run(parameters) {
Data data = getData();
storeData(data);
}
private storeData(data) {
em.persist(data);
}
? Spring , ? storeData() DAO , , - .