The example that Scott has given is the standard shopping cart example ...right. In that the 4 steps mentioned will not be separate method calls from the client. They all would be 4 steps within a method call from the client. Basically the client has selected items to be ordered. He gives credit card information. Both items and the credit card information will get passed to the application for processing with a single call.
The 4 steps will get executed under one transaction. Failure of any one of them would result in abotring the entire process.
I could understand the need for stateful session bean if the 4 steps were to be called separately as 4 methods from the client. In which case the client will have to remember and send data to the application. Instead of that storing the information in session bean would be more useful.
Originally posted by Ugender Rekulampally:
No, We can use LIKE expression.
And the example you have given is correct. you can look page 419 of HFEJB for some examples.
Originally posted by veena madhukar:
Can you please explain to me why we needed to create a stateful bean for createorder. We could have held all the orders in the httpsession and passed to stateless session bean. Now with stateful session bean we are storing it in the bean everytime the user selects an item to make order.