• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Is method @Transactional regardeless of invocation

 
Ranch Hand
Posts: 46
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

When I'm using @Transactional annotation on a method in a manager bean, is this method also transactional if invoked from within the bean itself?
I am asking this because I heard that spring manages this transactional behaviour by wrapping a bean inside a proxy. So if I call it from within a bean itself, then this wrapper will be avoided.
So it won't be transactional after all. Is this right? If so, is there any way to make method transactional regardless of invocation type?
 
Author
Posts: 141
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rade,
you are completely right. If you call those methods from inside your bean, they won|t be transactional. There is a "self" workaround, like describe here: https://tinyurl.com/jjezmzy .
 
Rade Koncar
Ranch Hand
Posts: 46
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting workaround to this problem. Thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic