Anyone having time to help?

Hi all,

am new to ejb and my problem is am having one jsp with three textboxes and three buttons like showbalance button, credit button, debit button. and i have two beans(one statefull and stateless)

inside statefull bean am having two variables like userName, amount and when ever the user clicks showbalance button i simply display the amount variable value and then if the user clicks credit button am simply add the textbox value with the bean's amount value and then i will call showbalance method from credit method the same is in the debit case also.

Now my problem is when ever am running the jsp i mean while cilcks the credit button its displays the credit amount as which i typed in the textbox i mean its not getting added with its previous value.

but if i do this with stateless na its getting updated but its keeps incrementing the values no matter about the client (even while running from same machine ie (first i want to kno how the clients are differentiated by ejb ? and how?) )

so i want to do this minibank application in which the app allow user to enter his name and display his balance and if he enters any amt and cllick credit button na it should add that amount with previous amount and it should be unique for clients no clients can see others amount

so any one plz help me..

am started to wait for u people..

if i ask anything wrong kindly adjust it and give me u r valuable idea's and suggestions

Thanks in advance..

GoodDay !....

[1530 byte] By [JaganMa] at [2007-11-27 1:16:14]
# 1
Stateless bean does not maintain state. So it has no idea nor does it care who the client is. That is each method invocation on a SLSB are independent calls. So in your case, you will need to identify the user, so you would need to use SFSB.
enigma_y2k1a at 2007-7-11 23:51:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

First of all i thank u for the response..

and now my doubt is what actually means " clients state with the bean"

what i understood is if suppose a bean having 5 business method means and if the client call those methods one by one and doing some job then that time period from homeObj.create() method to that 5 mtehod() calls duration is called session period of that user

and if its a Statefull bean then for the next round call with the same created home object leads the bean to create a new objects and treat the client as new one..

so my question here is i want to use a Statefull bean and by using that i want to create a mini bank application which maintains just user balance with credit(double) and debit(double) and showBalance() methods

and here am like to avoid any database

so now how my statefull bean will remember my client (IE) plz clear my doubt if i missed anything to mention plz ask me i will ask u again clearly.. because i like to understand EJB clearly so plz help me..

Thanks in advance..

JaganMa at 2007-7-11 23:51:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Each client of a SFSB will have a unique EJBObject for the client. So when you are invoking methods on the ejb, you are actually invoking methods on the same EJBObject. You dont have to do anything explicit for identifying that you are the same client in case of SFSB.
enigma_y2k1a at 2007-7-11 23:51:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...