How does a spring converter get a transactional scope?

Viewed 116

I was wondering, how a spring converter implementation gets an transactional scope.

Having a Converter which is used to convert a path placeholder (entity id) in an (rest) controller to the Entity itself. The Entity thus is loaded via Hibernate from the database.

For the details:

  • spring boot 2.3.2
  • A rest controller endpoint which triggers the converter to expand a path-placeholder (prior executing the rest-endpoint method body)
  • If in question, the controller method is not annotated @Transactional either

Question:

How (since we disabled OSIV) does this Converter get it's Transactional scope if the convert neither the method/nor the converter class is annotated using Transactional nor the convert method does custom transaction handling?

1 Answers

If you mean how Spring Data repositories get a transaction, the answer is all repository methods are transactional by default.

Related