Does a transaction occur in this case?

45 Views Asked by At

Does a transaction occur in this case?

@RestController
@RequestMapping("/api/v1/student/z")
@RequiredArgsConstructor
public class someServiceController {
    
        @Autowired
        public OtherSomeService othService;
    
        @GetMapping
        public ResponseEntity<?> someServiceControllers() {
            othService.Z();
            return ResponseEntity.ok("ok");
        }

}

public class OtherSomeService {
    
    @Autowired
    private SomeService s;
    
    public SomeData Z() {
        s.A();
       
    }
}


public class SomeService {

    
    public SomeData A() {
        B();
       
    }

    
    @Transactional
    public SomeData B() {
        //some codes
       
    }

}

chatgpt4 says it was created, but when I try, there is no transaction manager in the logs. can you help me?

log is as follows

o.s.security.web.FilterChainProxy : Secured GET /api/v1/student/z

o.s.web.servlet.DispatcherServlet : GET "/api/v1/student/z", parameters={}

s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to com.management.studentmanagement.controller.someServiceController#someServiceControllers()

o.j.s.OpenEntityManagerInViewInterceptor : Opening JPA EntityManager in OpenEntityManagerInViewInterceptor

o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'text/plain', given [*/*] and supported [text/plain, */*, application/json, application/*+json]

o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing ["ok"]

o.j.s.OpenEntityManagerInViewInterceptor : Closing JPA EntityManager in OpenEntityManagerInViewInterceptor

o.s.web.servlet.DispatcherServlet : Completed 200 OK

0

There are 0 best solutions below