What is a transaction?
A transaction is an indivisible unit of work
What are the 4 characteristics of a transaction?
What are the 3 things you must do to enable Spring Transactions?
Name some of the readily available implementations of PlatformTransactionManager
By default, what exception type rolls back a transaction?
RuntimeException
Do checked exceptions roll back transactions?
No
How can you customize the exception type that should cause a transaction rollback?
@Transactional(rollbackFor=…)
What are the 7 transaction propagation levels?
Define “transaction propagation”
Transaction propagation relates to how a transaction behaves when calling another transaction
Why should you consider using @Transactional(readOnly=true) when making multiple queries to a database?
Faster performance by using a single connection instead of 1 connection per query
True or False
The higher the transaction isolation level the slower the performance
True
Define “transaction isolation”
Transaction isolation relates to how isolated a transaction is from other transactions
What are the 5 levels of transaction isolation?
From what package should you import @Transactional?
From springframework not javax
What behavior does @Transactional have on @Test methods?
Rolls back database operations after execution. This means you don’t have to worry about cleaning up your database after testing
What does @Commit do?
Forces @Test methods annotated with @Transactional to commit database operations
How is transaction demarcation implemented behind the scenes?
@Around advice method