Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SessionBean calling multiple stored procedures

 
Veera Maria
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a following situation. I should make stateless session bean as a interface to stored procedures which are stored in database. Session bean should call one stored procedure and that procedure might call also another stored procedure to handle database actions and then return resultset to session bean.
So, my questions are:
- is stateless session bean suitable for this kind of usage?
- session bean should handle transactions, so what kind of transaction type
it should use? Some that is handled by container or JTA based?
- as I mentioned, there could be a 'chain' of stored procedure calls after
session bean has called the first stored procedure, so can session
bean's transaction type handle this kind of chained stored procedure
calls or how to handle commits or rollbacks?
Br
Vera
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- is stateless session bean suitable for this kind of usage?
Yes.
- session bean should handle transactions, so what kind of transaction type it should use? Some that is handled by container or JTA based?
I would suggest letting the container manage the transaction stuff. Which transaction isolation level you should use really depends on what the stored procedures are doing in the database.
- as I mentioned, there could be a 'chain' of stored procedure calls after session bean has called the first stored procedure, so can session bean's transaction type handle this kind of chained stored procedure calls or how to handle commits or rollbacks?
I haven't done much with stored procedures so I don't know if certain stored procedures can be rolled back, but from the container's point of view, it doesn't matter if the stored procedure internally calls other stored procedures.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic