Search
Duplicate
โ˜•

Transaction-propagation

supports

Support a current transaction, execute non-transactionally if none exists. Analogous to EJB transaction attribute of the same name.
ํ˜ธ์ถœํ•œ ๋ฉ”์„œ๋“œ์—์„œ ํŠธ๋žœ์žญ์…˜์ด ์žˆ์œผ๋ฉด ํŠธ๋žœ์žญ์…˜์„ ์ž‡๊ณ , ์—†์œผ๋ฉด ์—†๋Š” ์ฑ„๋กœ ๋†”๋‘”๋‹ค.
ํŠน์ด์ : ํ˜ธ์ถœํ•œ ๋ฉ”์„œ๋“œ์—์„œ ํŠธ๋žœ์žญ์…˜์ด ์—†์—ˆ์–ด๋„ ์ผ๋‹จ ํŠธ๋žœ์žญ์…˜ ์ƒ์„ฑ์€ ํ•œ๋‹ค. ํ•˜์ง€๋งŒ ์ ์šฉํ•˜์ง€๋Š” ์•Š๋Š”๋‹ค!
โ†’ exists, but not active!

mandatory

Support a current transaction, throw an exception if none exists
ํ˜ธ์ถœํ•œ ๋ฉ”์„œ๋“œ์—์„œ ํŠธ๋žœ์žญ์…˜์ด ์—†์œผ๋ฉด IllegalTransactionStateException ์˜ˆ์™ธ๋ฅผ ํ„ฐ๋œจ๋ฆฐ๋‹ค.

not supported

Execute non-transactionally, suspend the current transaction if one exists.
์ผ๋‹จ ์ƒ์„ฑ์€ ํ•œ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์“ฐ์ง€๋Š” ์•Š๋Š”๋‹ค!
๋ฌผ๋ฆฌ์  ํŠธ๋žœ์žญ์…˜๊ณผ ๋…ผ๋ฆฌ์  ํŠธ๋žœ์žญ์…˜์˜ ์ฐจ์ด์ธ ๋“ฏ ํ•˜๋‹ค!

nested

Execute within a nested transaction if a current transaction exists, behave like REQUIRED otherwise. Note: Actual creation of a nested transaction will only work on specific transaction managers. Out of the box, this only applies to the JDBC DataSourceTransactionManager.
ํŠน์ •ํ•œ transaction manager ์—์„œ๋งŒ ์ž‘๋™ํ•œ๋‹ค๊ณ  ํ•œ๋‹ค.
ํ˜ธ์ถœํ•œ ๋ฉ”์„œ๋“œ์—์„œ ํŠธ๋žœ์žญ์…˜์ด ์žˆ์œผ๋ฉด NestedTransactionNotSupportedException ์˜ˆ์™ธ๊ฐ€ ํ„ฐ์ง„๋‹ค.
ํ˜ธ์ถœํ•œ ๋ฉ”์„œ๋“œ์—์„œ ํŠธ๋žœ์žญ์…˜์ด ์—†์œผ๋ฉด ์ƒˆ๋กœ ์ƒ์„ฑ์„ ํ•œ๋‹ค.
mandatory ์™€ ๋ฐ˜๋Œ€ ๋Š๋‚Œ์ด๋‹ค.

never

| Execute non-transactionally, throw an exception if a transaction exists.
ํ˜ธ์ถœํ•œ ๋ฉ”์„œ๋“œ์—์„œ ํŠธ๋žœ์žญ์…˜์ด ์žˆ์œผ๋ฉด IllegalTransactionStateException ์˜ˆ์™ธ๋ฅผ ํ„ฐ๋œจ๋ฆฐ๋‹ค.
ํ˜ธ์ถœํ•œ ๋ฉ”์„œ๋“œ์—์„œ ํŠธ๋žœ์žญ์…˜์ด ์—†์œผ๋ฉด ํŠธ๋žœ์žญ์…˜์„ ์ƒ์„ฑํ•˜๊ธฐ๋Š” ํ•˜๋Š”๋ฐ ์ ์šฉํ•˜์ง€๋Š” ์•Š๋Š”๋‹ค.
์ด ๋˜ํ•œ ๋ฌผ๋ฆฌ์ /๋…ผ๋ฆฌ์  ์˜ ์ฐจ์ด์ธ ๊ฒƒ ๊ฐ™๋‹ค.