This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
We have a problem with MDB listening to a Foreign JMS Queue which is configured on same machine [server 1]. This foreign JMS Queue is configured to listen to another Queue defined on a remote machine [server 2].
The onmessage() of MDB is expected to carry out DB operations[fetching encrypted BLOB object with other data types] based on header data in the message received and transmit a new message to another response Queue configured on same machine.
The PROBLEM we are facing is
The MDB is able to receive the first message, carry out DB fetch operation and transmit it to the response queue
But for 2nd message onwards the DB fetching returns no data despite the data being present in Database.
Gives error as :
<Jan 12, 2006 11:40:44 AM GMT+05:30> <Warning> <J2EE> <BEA-160081> <The JMS connection factory resou<br /> <br /> rce FM_JMS_CONNECTION_FACTORY declared in the EJB "fileDeliveryjmsMessage" as part of application "_<br /> <br /> appsdir_serverFarmApp_ear" does not support XA. It cannot be used inside a transaction context.>
<Jan 12, 2006 11:40:45 AM GMT+05:30> <Warning> <J2EE> <BEA-160081> <The JMS connection factory resou<br /> <br /> rce FM_JMS_CONNECTION_FACTORY declared in the EJB "fileDeliveryjmsMessage" as part of application "_<br /> <br /> appsdir_serverFarmApp_ear" does not support XA. It cannot be used inside a transaction context.>
Observed that if we write context.setRollback() in case of exceptions of onMessage() the data is retrieved from DB after repeated 2-4 failures!!
It works fine if we have both the queues reside on same server.
Appreciate if you can let me know on how to get this working?
Do you see any specific problems with configuration of Foreign Queue or Oracle XA connection pool as transaction, etc.?
We are using Oracle 10G & Weblogic Prtal Server 8.
Also have defined a XA connection pool for DB connection.
Working of Foreign JMS Queue required us to define different Portal Domain and Server names for the 2 servers.
Necessary resource references (wrapper) are defined for MDB in the deployment descriptors
When a application connects to a message queue and database, this really counts as two databases, ergo an XA transaction that supports 2PC is required. The reason this does not happen when the queues are on the same server is that WebSphere performs optimization to avoid the 2PC because the connections are local and pointing to the same database. On a foreign connect, a 2PC is forced, and the database drivers must be XA compliant as well as the databases themselves must support 2PC.