Hi Gavid, With stateless session beans it is not adivisable to use any instance variable beacause stateless session beans are pooled randomly depennding upon requests made. It will give random behaviour. Since u have tried from only two machines, u are feeling it like this, but in multiple requests coming simultaneously, value of x can be anything depending on the instance of the bean assigned to cater the request. It is advisable not to use instance variables in Stateless session bean. Regards Mohit - ([EMAIL PROTECTED])
********************************************************************* Original Message : Hi, I have a problem of understanding what is meant by "Stateless Session Bean do not hold state". In my sample application I have a - stateless session bean called SSB - which has a instance variable called x - The SSB has a method called addOneToX() which increase x by one. - I have a servlet called conectToSSB which looks up the SSB and calls the addOneToX() method. - I access the conectToSSB servlet from 2 different machines. My problem is when I query the value of x for the first client it is 1 but for the second client it is 2. Which means the SSB has been holding state. Which is wrong because when the second client accesses the SSB it should get a fresh SSB. Am I doing something wrong ? Thanks, Gavin (Analyst Programmer JKCS, Sri Lanka) =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
