I want to read text data fixtures (CSV files) at the start on my application and put it in my database.
For that, I have created a PopulationService with an initialization method (@PostConstruct annotation).
I also want them to be executed in a single transaction, and hence I added @Transactional on the same method.
However, the @Transactional seems to be ignored :
The transaction is started / stopped at my low level DAO methods.
Do I need to manage the transaction manually then ?
Best Answer
Quote from legacy (closed) Spring forum:
So if you would like something in your
@PostConstruct
to be executed within transaction you have to do something like this: