Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling stored procedures from Session bean's business methods  RSS feed

 
Tejas Bavishi
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am curious as to what is the effect of calling stored procedures that start and commit/rollback transactions within the database tier.
The session bean business methods that call this kind of stored procedures, should they take any special precautions ? How session beans will behave under bean managed transaction / container managed transaction that call this stored procedures?
Thanks in advance for your replies.
 
Sujatha Kumar
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling Stored Procedures from EJB is not recommended.
In fact J2EE architecture never recommends to do that.
 
Tejas Bavishi
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could you point me to official J2EE recommendation/white papers that discourage calling stored procedures from the session beans.
Thanks for your response.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not commit in the stored procedure leave it to the container. SP are discouraged because they are not portable across databases.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!