aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes SessionBean calling multiple stored procedures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "SessionBean calling multiple stored procedures" Watch "SessionBean calling multiple stored procedures" New topic
Author

SessionBean calling multiple stored procedures

Veera Maria
Greenhorn

Joined: Sep 04, 2003
Posts: 2
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
- 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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SessionBean calling multiple stored procedures