Domanda

I have got a EJB deployed in Weblogic server. From another remote client, I use JNDI to look up the EJB and calls a method which inserts some records within a distributed transaction. Then when it returns back to the remote client I try to do one of the activities below and it fails with following results:

A)Try to retrieve an object that was inserted by the EJB in the remote client using the key sent back from the EJB and cannot find the record.

B) Try to insert a different record (that do not have any constraint on the records inserted by the EJB) in the remote client (using Eclipselink JPA) and it throws an exception "ORA-02049: timeout: distributed transaction waiting for lock"

I do not do any commit in the EJB end and let all to be handled by the container. My transaction attribute is set to REQUIRED in EJB server methods and the client methods.

On the EJB and the remote client both use the XA database connection. Why can't they both see each other's changes?

Can anyone shed some light on this issue. I am not sure what is going on here?

È stato utile?

Soluzione

I have resolved this issue. The issue was that the connection used by the EJB was not XA. Earlier I assumed that our existing application is using the XA connection. So, I had to place the interceptor annotation on the EJB to use the XA connection as follows:

@Interceptors({JtaXaDataSourceRegistryInterceptor.class})

When using the remote EJB and Transactions it requires to have the XA connection in both client and the server where the EJB resides to participate in two phase commit in database activities.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top