How Can jBilling Help You?
Who’s Using jBilling?

“The support we get from jBilling is excellent.”
Ingram Leedy
Elephant Outlook
See all testimonials >

AVAILABLE - Get rid of EJB stateful session bean

Current functionality:
There is an stateful session bean com.sapienter.jbilling.server.order.NewOrderSessionBean. This class is used by the web tier when creating a new order from the GUI.

Desired functionality:
We do not want any stateful session beans in the system, there is no real need for them and their presence might lead to scalability issues in some scenarios. What this class does has to be moved either to the web tier or to the server class OrderSessionBean, which is stateless.

Technical overview:
This is not for beginners. You will need to have a good understanding of EJB session beans and jbilling's tiered design. Most of what this class does belongs to the web tier. It acts like a shopping cart: it gets called when the user adds or removes an item when creating a new order. Note that the whole idea of this task is to make jbilling code and design more elegant, so you'll need to carefully review the existing code and think well how to do your changes.
The actual session bean on the client side now is held in an HTTP session instance. You can get rid of this and just use the HTTP session for the actual shopping cart.
Right now, when you add an item to an order (or remove one), you are having a remote call to the session bean in the server tier. After this modification, it won't make the remote call; it'll handle the 'order building' in the order form all in the web tier.

To test this, there are two steps. One is to create an order from the GUI: add and remove items to it, change quantities in the review page and see that everything makes sense.

The other one is to run the ant task 'test-ws'. First, make sure you are using the latest code in the SVN repository. Edit build.xml and change the line 465 from 'payment' to 'order'. Also, use the development HSQL database (see the 'building from source' guide in the documentation).

Client tier modifications:
You will have to put the 'shopping cart' logic in this tier, and stop calling the remote session bean NewOrderSessionBean.

Server tier modifications:
NewOrderSessionBean has to go. Some of its code might go into OrderSessionBean, but I'm not sure about this.

Database tier modifications:
None.

Changes mostly to be done in these files:
com.sapienter.jbilling.server.order.NewOrderSessionBean
com.sapienter.jbilling.client.order.MaintainAction
com.sapienter.jbilling.client.order.ReviewOrderAction
com.sapienter.jbilling.client.order.NewOrderItemAction

 
dolson wrote 2 years 10 weeks ago

I believe this item is no longer available

It appears to have been deleted in revision 430.

Daryl O.

 
shantisattiraju wrote 2 years 30 weeks ago

is this change available?

Hi ,

I am interested in doing this change.Is this change still available ?

econde wrote 4 years 7 weeks ago

This remains available,

This remains available,

Emiliano Conde
Lead Developer - jBilling

Please register or login to post a comment.