I have an existing application that is written in EJB2.1. This is deployed on jboss-5.1.0.GA as an EAR.
I now have a new requirement to implement a process which is supposed to be used by the EJB2.1 application. Both will be in their own ear files but will both be running on the same jboss-5.1.0 instance.
My questions are:
The EJB3 specification allows a smooth transition,defining methods for EJB2/EJB3 interoperability, it's sometimes bulky and you will need artifacts not necessary in a 'normal' EJB3 app ( @RemoteHome
)
- Is it possible to call the services of the EJB3 ear from the EJB2.1 ear?
Yes, it is possible, see: Referencing EJB3 beans in EJB2.1 and Introduction to using EJB2.1 client adaptors and the sample project "ejb21_client_adaptors"
- If the answer to the above is yes, is it possible to manage the transactions? ie only have the EJB2.1 application commit any transactions.
Yes, just remember to annotate your EJB3 method with @TransactionAttribute(TransactionAttributeType.MANDATORY)
- The EJB3 services will be called from session beans in the EJB2 application. Is this the wrong way to do it? (ie the session bean is not a client).
I see no problem here, session beans can call other beans' services.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.