I am fresher to EJB, working on a maintenance application that is using EJB2.0. I am just going through the application code and trying to understand it. It has got ejb-jar.xml with some session beans as shown below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>StatelessBean</ejb-name>
<home>com.example.interfaces.StatelessBeanHome</home>
<remote>com.example.interfaces.StatelessBean</remote>
<local-home>com.example.interfaces.StatelessBeanLocalHome</local-home>
<local>com.example.interfaces.StatelessBeanLocal</local>
<ejb-class>com.example.interfaces.StatelessBeanSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-identity>
<use-caller-identity>
</security-identity>
<resource-ref>
<res-ref-name>eis/SAPFactory</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Application</res-auth>
<re-sharing-scope>Shareable</re-sharing-scope>
</resource-ref>
</session>
</enterprise-beans>
</ejb-jar>
I see that the resource authentication can be either Application or Container based, in the above snippet it is Application, in some other applications I have seen it being mentioned as Container, what exactly is the difference between them? When to use over other. Also, the transaction type is also specified as Container, please throw some light on this as well.