Reputation: 12876
If I have a public EJB stateful session bean method that is annotated with the Required transaction annotation and it calls a private method on the same EJB but that private method is not annotated with a transaction annotation, will I run into any potential transaction issues?
Assume that the public method is annotated to require a transaction, it gets a database connection, makes an update, calls the private method which also updates the database, the private method returns and the public method commits the transaction.
Should I really be putting "supports" as the transaction annotation on the private method or am I OK not putting any annotation on that method?
I am running in WebLogic 11g as my container.
Upvotes: 0
Views: 285
Reputation: 949
You're absolutely OK not putting any annotations on that method. In fact, if you're calling your private method just like "myPrivateMethod(...)", annotations on that method have no effects. They only matter if you're calling the method through an EJB proxy, which you can get by JNDI lookup or DI.
Upvotes: 1