Search code examples
javamultithreadingspringhibernate

Transactional Synchronization


I am new to spring. I have a piece of code written above several of my methods in my project.

@Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)

What I have been able to search on it is, this code refers to Transactional synchronization and this particular code means that , if two threads come at the same time and make some database update, all the database updations will be executed when both the threads finish their execution. I am right on my analysis? Also could anyone throw some more light on this topic.


Solution

  • No, your statement is not right.

    If you scrap the word Synchronization and you replace the word thread with transaction from your text then you are on the right path.

    Spring Transaction Management is not a light matter as it may deceptively appear by the declarative annotations.

    Read the detailed Documentation.