Spring Vs EJB ( A feature comparison)

By: Emiley J. Emailed: 1643 times Printed: 2111 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

In quite a few design brainstorming sessions, the debate between Spring and EJB results in a deadlock. There are developers who are damn passionate about Spring and hate EJBs. Let’s have a look at the main important differences between the two in terms of features they support.

 

 

 

 

 

 

 

 


 

Feature

EJB

Spring

Transaction management

  • Must use a JTA transaction manager.
  • Supports transactions that span remote method calls.
  • Supports multiple transaction environments through its PlatformTransactionManager interface, including JTA, Hibernate, JDO, and JDBC.
  • Does not natively support distributed transactions—it must be used with a JTA transaction manager.

Declarative transaction support

  • Can define transactions declaratively through the deployment descriptor.
  • Can define transaction behavior per method or per class by using the wildcard character *.
  • Cannot declaratively define rollback behavior—this must be done programmatically.
  • Can define transactions declaratively through the Spring configuration file or through class metadata.
  • Can define which methods to apply transaction behavior explicitly or by using regular expressions.
  • Can declaratively define rollback behavior per method and per exception type.

Persistence

Supports programmatic bean-managed persistence and declarative container managed persistence.

Provides a framework for integrating with several persistence technologies, including JDBC, Hibernate, JDO, and iBATIS.

Declarative security

  • Supports declarative security through users and roles. The management and implementation of users and roles is container specific.
  • Declarative security is configured in the deployment descriptor.
  • No security implementation out-of-the box.
  • Acegi, an open source security framework built on top of Spring, provides declarative security through the Spring configuration file or class metadata.

Distributed computing

Provides container-managed remote method calls.

Provides proxying for remote calls via RMI, JAX-RPC, and web services.


Java Beans Home | All Java Beans Tutorials | Latest Java Beans Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(4)


1. View Comment

Thanks for this nice comparision table for Spring Vs EJB.

View Tutorial          By: guddu at 2009-10-17 03:08:59
2. View Comment

It seems author has half knowlage
EJB main Feture is Distributed Computing (as you can say extension of RMI/Corba) ,
Transaction managment etc is there secondary feture


View Tutorial          By: Aryan Siddharth Singh Gautam at 2010-03-22 03:40:11
3. View Comment

Thanks for the Topic. But there are many more comparison to be done. What I love about Spring is it's POJO orientation.

View Tutorial          By: Uditha Madumal at 2010-09-15 19:39:13
4. View Comment

EJB's can be deployed on multiple servers and when they communicate togehter they can have one distributeed transaction, and this is important when we use serivce oriented architecture

View Tutorial          By: Tomek at 2011-09-12 12:29:07

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Emiley J.
Error generating R.java from manifest
ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client
IIS and Tomcat - how to configure to work together
PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/php4/lib/php/extensions/no-debug ......
Adding your own Application icon for your J2ME application (jar file)
Creating Menus in Code using VB.net
Traversing all files in a directory using Ruby
Using Proxy to connect to URLs in Ruby
POST a form in Ruby
Reading URL content using Ruby (HTTP)
dRuby client/server mode sample program
Benchmark module in Ruby
encoding and decoding in Ruby using Base64 Module
Module Abbrev in Ruby
Standard Library Packages in Ruby

More Tutorials in Java Beans
Creating a JavaBean to Connect with Google API
Spring Vs EJB ( A feature comparison)
What is EJB server and what are EJB Components?
JavaBeans Basic Concepts
JavaBeans vs. Custom Tags
Java Beans and the Expression Language
A sample that shows Java Beans, Servlets and JSP working together
Advantages of Java Beans
Design Patterns for Properties in a Java Bean
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ADVANTAGES OF EJB
Steps to develop EJB Environment
EJB is a server side component:
Entity Bean
History Of Java

More Latest News
Most Viewed Articles (in Java Beans )
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
A sample that shows Java Beans, Servlets and JSP working together
Advantages of Java Beans
Java Beans and the Expression Language
What is EJB server and what are EJB Components?
Spring Vs EJB ( A feature comparison)
Reusable component
JavaBeans Basic Concepts
ADVANTAGES OF EJB
Design Patterns for Properties in a Java Bean
Steps to develop EJB Environment
EJB is a server side component:
Entity Bean
History Of Java
JavaBeans vs. Custom Tags
Most Emailed Articles (in Java Beans)
Steps to develop EJB Environment
JavaBeans vs. Custom Tags
Reusable component
ADVANTAGES OF EJB
EJB is a server side component:
Entity Bean
History Of Java
Spring Vs EJB ( A feature comparison)
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Java Beans and the Expression Language
Advantages of Java Beans
Design Patterns for Properties in a Java Bean
A sample that shows Java Beans, Servlets and JSP working together
JavaBeans Basic Concepts
What is EJB server and what are EJB Components?