I did some badness today.
I wanted an integration test to check to see if my @Transactional method actually did rollback on an optimistic lock failure. It’s a pretty business critical method so I wanted to be sure that the whole @Transactional and @Version annotation voodoo actually works.
The approach I took was to inject, what I called a “slowRepository” into the object with the @Transactional method. The slowRepository is just a mockito mock of the object which “answers” (using “thenAnswer”) to the “findBy…” with some custom code.
The idea is that at some point during the @Transactional method the slowRepository is called and the “answer” code is invoked. In the test, the answer code follows along the lines of:
1. Grab the data it requires from the (not slow) repository (the repository the slowRepository is mocking)
2. Switch back the slowRepository for the not slow repository
3. Invoke the @Transactional method again on a separate thread
4. Sleep for a bit
5. Wake up and return the data from step 1
The @Transactional call on the separate thread completes and commits before slowRepository wakes up. When it does, slowRepository returns stale data and the @Transactional method then fails accordingly.
The problem I encountered was using the setters for my @Autowired dependencies on the bean with the @Transactional method. I needed to use the setters so that I could switch in and out the slowRepository, but couldn’t because Spring AOP proxies are implementations of an interface, not subclasses (by default – yes I realise you can get Spring to proxy the target class using CGLIB). I found this blog post which explains how to get at the target object behind a Spring proxy. I converted it to Scala:
…which is pretty ninja.
https://www.bitsdujour.com/profiles/oUD7so
перепланировка квартиры в москве sostav.ru/blogs/286398/77663 .
https://telegra.ph/Donat-alert-11-27
https://textualheritage.org/index.php?option=com_comprofiler&Itemid=62
https://telegra.ph/Zaregistrirovat-ooo-onlajn-11-15
https://justpaste.me/vMp83
https://telegra.ph/Vivo-zakvaski-oficialnyj-sajt-12-01
https://telegra.ph/Igra-lego-siti-policiya-s-mashinami-s-banditami-igrat-onlajn-02-21
https://4dkp.forum24.ru/?32-aliciagreen
http://anapatattoo.ru/index.php?subaction=userinfo&user=aliciagreen
https://igiasu.com/2026/02/26/%d0%be%d1%82%d1%86%d1%8b-%d0%b8-%d0%b4%d0%b5%d1%82%d0%b8-%d1%81%d0%bb%d1%83%d1%88%d0%b0%d1%82%d1%8c-%d0%b0%d1%83%d0%b4%d0%b8%d0%be%d0%ba%d0%bd%d0%b8%d0%b3%d1%83/
начало действия виагра
https://telegra.ph/Dorama-k-pop-vyzhivaet-silnejshij-11-09
https://logcla.com/blogs/1281909/%D0%A3%D1%80%D0%B0%D0%BB%D1%81%D0%B8%D0%B1-%D0%B0%D0%B2%D1%82%D0%BE%D0%BA%D1%80%D0%B5%D0%B4%D0%B8%D1%82
https://4dkp.forum24.ru/?1-18-0-00007707-000-0-0-1772055248
попперс Пенза
https://textualheritage.org/index.php?option=com_content&task=view&id=6588
виагра оптом 55
melbet рабочее зеркало melbet рабочее зеркало
sms activate login sms activate login .
amsterdam black label попперс
с а н к т
https://telegra.ph/Supra-stv-lc40st900fl-11-17
лекарство для продление полового акта
https://telegra.ph/Ivi-smotret-besplatno-filmy-02-04
виагра увеличивает ли продолжительность
https://telegra.ph/Hehppines-11-16
https://site524092147.fo.team
https://telegra.ph/Brax-02-21
купить таблетки виагра
https://telegra.ph/Sfi-11-18
sms activate service sms activate service .
купить попперс в россии
https://ey25ca.zombeek.cz
https://paiza.io/projects/EoaEFUzsQ83ky3oYELD0sw
https://p2klxv.zombeek.cz
таблетки сиалис инструкция цена
https://www.bitsdujour.com/profiles/UIHkMn
https://fgs3fe.zombeek.cz
https://site521919698.fo.team
https://dakyir.zombeek.cz
https://paiza.io/projects/8W5Ma241pkO4gLTOcgEI-Q
к у п и т ь
виагра без побочных
попперс партнерка
https://rentry.co/4kno3dof
https://telegra.ph/Hudozhnik-renuar-02-15
doppelte chance wette
Here is my homepage … esport wetten deutschland verboten
https://rld1ue.zombeek.cz
купить попперс омск