Everywhere is written that service(or whatever) method should be Transactional for JPA Persistence Context to be created, but I can't find anywhere what is the motivation of such design.
Say I want to insert one row to DB, it is just one DB statement which will be anyway transactional if autocommit
is enabled. But suddenly if you use JPA/Hibernate then you have to make your business method @Transactional for JPA to be able to create a Persistence Context and execute that single statement.
In the JPA-less world we can have a non-transactional service method containing even multiple DB statements, of course, taking the risk of losing the atomicity of the whole operation(that is definitely our choice), so why JPA is designed that way forcing us to create Transactional methods even when that method contains single DB statement and anyway that statement will be executed in transaction with autocommit=true
?