Some interesting features of the EJB 3.1 specification:
- Local interfaces are optional now, we still need @Remote (which is good)
- EJB-Jars are optional - session beans can be deployed into a WAR-file - but are still independent
- Singleton beans (with new @Singleton Annotation): not intended to be a cluster-wide singleton, but the state is shared in the whole application
- Singletons can be accessed in @ReadOnly mode - a hint to container to optimize the access
- Singletons can be accesseed in @ReadWrite mode as well
- BMC (Bean Managed Concurrency, or @BeanManagedConcurrency) will be available. In this case the developer is responsible for synchronization - so usage of synchronized keywords etc. is allowed in that particular case
- Timer Services will be extended to CRON like functionality. Timer could be registered automatically using an annotation.
- @Asynchronous annotation can be used to mark methods (of a stateful session bean) which will be executed asynchronously.
- Stateful Session Beans could be also exposed as a WebService - so stateful WebServices will be supported.
EJB 3.1 makes EJB 3.0 even leaner and better. I only miss the standardization of JNDI-names - but this JSR spec was not even started, so there is still hope...