Session bean

How can I differentiate between a stateful and a stateless Session bean?
[79 byte] By [asif_need_javaa] at [2007-11-27 2:40:56]
# 1
Use @Stateless or @Stateful in your bean definition as follows:@Statefulpublic class HelloBean implements Greeter {....}Here are some examples:https://glassfish.dev.java.net/javaee5/ejb/EJB30.html
Mahesh.Kannana at 2007-7-12 3:04:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

For stateless session bean ...

1. Home interface has only one create() method without arguments....

2. There is no concept of Activation,Passivation.

3. One bean can be served for 'n' number of clients, but only one at a time..coz' it won't maintain state.....

For Stateful session bean.....

1. Home interface can have one or more create() methods, with or without arguments.....

2. Activation And Passivation is there because of pool concept.......

3. One bean can only serve for one client at any point of time.... coz' it has to maintain state...

These are the major differencesssssss......

balu45a at 2007-7-12 3:04:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...