I am getting EjbTransactionRequiredException when method with MANDATORY transaction attribute is called in remote session bean. I doubt that whether transaction context from Spring can be propagated to remote session bean? If this is possible, then what might be going wrong in my case.
I can post code snippets or configuration if required.
I am using JBoss 5.0.1 GA release. When I am calling remote session bean residing in the same server instance, it works perfectly fine but not getting following stack trace when remote session bean is deployed in separate server instance.
Configurations for TransactionManager & Datasource
UserServiceImpl class :
When I am calling remote session bean residing in the same server instance, it works perfectly fine but getting following stack trace when remote session bean is deployed in separate server instance.
See this http://www.coderanch.com/t/513513/JBoss/JBOSS-Distributed-Transactions
What I exactly intent to achieve is I want to seamlessly have distributed transaction achieved i.e. container should be managing distributed transaction. As shown in the example in previous post, when save() method shown in the snippet is called, spring looks up java:/TransactionManager from local Jboss server(site 1) & transaction is started, it then delegates call to userDao.save() method in remote session bean at Jboss server(site2). I want that in this call, active transaction should be propagated to site 2. Is it possible to achieve?
Have you tried using some other Datasource provider(The one configured using the Driver provided by Database you are using). As you are using a Commons DBCP pool, AFAIK it is the basic implementation of connection pool and datasource. May be you can check with the documentation of DBCP whether this connection can take part in distributed transacation.
I had a similar issue when communicating across Websphere Servers of different versions.
To get it working I had to turn off Transaction Authorization Coordination. Though this sounds like some thing wrong that is what is recommened by IBM.
So you might have something like this to be configured in Jboss.
See if this helps
I think that discussion refers to quite older jboss version. I guess JBoss 5.0 supports 2+ jvms & includes arjuna products.
Just want to add one more isolation if someone can give inputs from that. I tried to call that same remote ejb(site 2) from other EJB located at site 1. But getting the same exception. So spring & its injections are not in the picture now. Just I want to have transaction propagation between two remotely located ejbs. I think it is quite common scenario in ejb environment. Eagerly looking for some help.
sorry but I am getting totally confused.
Here are the queries and observations I have:
JBoss supports the first 2 cases via "ClientUserTransactionService" which is described in the AS user guide (see http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch4.chapt.html):
The ClientUserTransactionService MBean publishes a UserTransaction implementation under the JNDI name UserTransaction.
so it means I need to use BMT to achieve this right?? what if I am using CMT, just like what is shown in the example in the discussion, using java:TransactionManager
While it does support propagating transaction contexts with remote calls, it does not support propagating transaction contexts to other virtual machines, so all transactional work must be done in the same virtual machine as the JBoss server.
I am not able to get what this quote says.
If transaction contexts are to be propagated with RMI/JRMP calls, the transaction manager must also implement two simple interfaces for the import and export of transaction propagation contexts (TPCs). The interfaces are TransactionPropagationContextImporter, and TransactionPropagationContextFactory, both in the org.jboss.tm package.
These interfaces and their JNDI locations are:
The javax.transaction.TransactionManager interface is used by the application server to manage transactions on behalf of the transactional objects that use container managed transactions. It must be bound under the JNDI name java:/TransactionManager.
The TransactionPropagationContextFactory interface is called by JBoss whenever a transaction propagation context is needed for transporting a transaction with a remote method call. It must be bound under the JNDI name java:/TransactionPropagationContextImporter.
The TransactionPropagationContextImporter interface is called by JBoss whenever a transaction propagation context from an incoming remote method invocation has to be converted to a transaction that can be used within the receiving JBoss server VM.
so that JBoss' implementation of TransactionManager got by java:/TransactionManager doesn't implement TransactionPropagationContextImporter & TransactionPropagationContextFactory interfaces?? what things should I do to have CMT, transaction propagation across remote calls & 2 phase commit?
When studying EJB specs, I thought distributed transaction propagation across remote calls should be seamlessly achieved, without putting much efforts in system level details.