Our Application uses a BMP ejb 2.1 entity bean . All database interactions are through plain JDBC and transactions. commit / roll back are handled at the session bean that invokes the 2.1 entity bean. We plan to remove the entity bean layer as it is no longer supported by the Java EE containers.
This is acheived by converting the entity bean to POJO DAO layer and removing the bean defnition from ejb-jar.xml. resource-ref are defined for all the entity beans.
Is it sufficient to ensure that if the session bean calling the 2.1 entity bean has the same resource-ref defined?
can i remove the entity bean definition along with the resource reference and continue to use as a POJO DAO layer ?
I have tried the same approach of removing the entity definition along with the resource reference and validate the DB commits are working fine. Wanted to check if i have missed to consider any use case.
<enterprise-beans>
<entity>
<display-name>EmployeeBean</display-name>
<ejb-name>EmployeeBean</ejb-name>
<local-home>employee.EmployeeHome</local-home>
<local>employee.Employee</local>
<ejb-class>employee.EmployeeBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>employee.EmployeePK</prim-key-class>
<reentrant>False</reentrant>
<resource-ref>
<res-ref-name>jdbc/OracleDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</entity>
</enterprise-beans>
Employee Bean i am converting from EJB to POJO and removing the entity definition from ejb-jar.xml . Will the Database interaction still work with out the resource-ref and will it participate in the JTA transaction if the calling session bean has defined the same resource reference?