• Post Reply Bookmark Topic Watch Topic
  • New Topic

Security and transactions on self invocation: EJB vs. Spring

 
Thomas Kruse
Greenhorn
Posts: 14
Firefox Browser Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the following question I could not find information in regards to EJB, I would be happy if someone could help me with that:

Using the Spring framework AOP dynamic proxies to realize security constraints and transaction handling it is important never call a method without going through the proxy. (This is described here: http://static.springsource.org/spring/docs/3.0.x/reference/transaction.html#transaction-declarative-annotations )

I wonder if the same holds true for EJBs.

For example I have a stateless EJB with methods foo() and bar() and I call foo() from an external class (onto injected EJB) and within the I call the bar() method from "inside" the foo() method.
(AFAIK in Spring this would be a plain java method call, and could circumvent security and transaction behavior configured for this method.)

Is the behavior specified for that case, is it container vendor dependant and what is the expected behavior?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thomas Kruse wrote:

I wonder if the same holds true for EJBs.



Yes, that holds true for EJBs too. See this previous discussion http://www.coderanch.com/t/537375/EJB-JEE/java/transactions#2438975
 
Thomas Kruse
Greenhorn
Posts: 14
Firefox Browser Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh I missed that even though I searched.

Thanks a lot!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!