Open mklinkj opened 4 months ago
It seems like there’s no need for various modifications… Just changing addItem() to addItemNoRollback() in the line above should do the trick. 😂
Hello!
Thank you for your interest in my book. I am glad things are clear now, good luck further!
On Monday, May 6, 2024, mklinkj @.***> wrote:
https://github.com/ctudose/java-persistence-spring-data-hibernate/blob/ 586c2126775b8d7caabb635a14ce322cc48d6d2a/Ch11/transactions5- springdata/src/test/java/com/manning/javapersistence/ch11/concurrency/ TransactionPropagationTest.java#L131
It seems like there’s no need for various modifications… Just changing addItem() to addItemNoRollback() in the line above should do the trick. 😂
— Reply to this email directly, view it on GitHub https://github.com/ctudose/java-persistence-spring-data-hibernate/issues/5#issuecomment-2094978817, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKRPZWHN4GWS5DYX4LCOOVLZA2Y43AVCNFSM6AAAAABHICNYBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJUHE3TQOBRG4 . You are receiving this because you are subscribed to this thread.Message ID: <ctudose/java-persistence-spring-data-hibernate/issues/5/2094978817@ github.com>
hello.
Java Persistence with Spring Data and Hibernate has been published in Korea, so I am reading it well.
Among the example tests in Chapter 11, there is a
noRollback
test method as follows, but I am inquiring because it does not seem to be a test of the operation ofnoRollback
.https://github.com/ctudose/java-persistence-spring-data-hibernate/blob/586c2126775b8d7caabb635a14ce322cc48d6d2a/Ch11/transactions5-springdata/src/test/java/com/manning/javapersistence/ch11/concurrency/TransactionPropagationTest.java#L123-L136
Since noRollback is set in ItemRepository#addItemNoRollback() -> LogRepository#log(), it seems that there must be a scenario where duplication occurs when calling addItemNoRollback().
In the case of ItemRepository#addItem() in the middle, it seems to have no relation to setting noRollback because it is set to REQUIRED_NEW.
So I thought about the following test code:
Then, I will finish reading the book. I've read up to chapter 11 now..😅
thank you have a good day. 👍