ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » MQSeries Issue/ Generic RA for JMS

Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next
 MQSeries Issue/ Generic RA for JMS « View previous topic :: View next topic » 
Author Message
fjb_saper
PostPosted: Fri Aug 12, 2005 3:27 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Are you trying to write the XA transaction manager or just use it ?

Code:
if (xar2.isSameRM(xar1)) {
xar2.start(xid, XAResource.TMJOIN) // HANGGGGGGGGG
}


So if both resources are one and the same you start it ? Again because I suppose you already started xar1 ?

Are you supposed to do that ?

Read up on the XA specification by Sun. It should contain all the information you need to get to a successful conclusion.

Enjoy
Back to top
View user's profile Send private message Send e-mail
binod
PostPosted: Sat Aug 13, 2005 6:09 pm    Post subject: Reply with quote

Novice

Joined: 05 Aug 2005
Posts: 19

fjb_saper wrote:
Are you trying to write the XA transaction manager or just use it ?

Code:
if (xar2.isSameRM(xar1)) {
xar2.start(xid, XAResource.TMJOIN) // HANGGGGGGGGG
}


So if both resources are one and the same you start it ? Again because I suppose you already started xar1 ?

Are you supposed to do that ?

Read up on the XA specification by Sun. It should contain all the information you need to get to a successful conclusion.

Enjoy


Oh... No.. You JUST DONT understand XA protocol.

if (xar2.isSameRM(xar1)) {
xar2.start(xid, XAResource.TMJOIN) // HANGGGGGGGGG
} else {
xar2.start(xid, XAResource.TMNOFLAGS)
}

This will be the full code in TM. You should go and read spec. I have read all these specs enough.... If you still feel strongly why dont you explain difference between TMJON and TMNOFLAGS.... Dont reach conclusions, if you dont understand the technology well enough.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Aug 14, 2005 5:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Look if the resources are the same I suppose you already joined using xar1.
There might be some problem doing it twice !!
Code:
xar1.start(xid,XAResource.TMJOIN);
if (xar2.isSameRM(xar1)) {
xar2.start(xid, XAResource.TMJOIN) // HANGGGGGGGGG
//this is the same as if you had written
xar1.start(xid, XAResource.TMJOIN);
}


I guess you intended to do something like this
Code:
if (! xar2.isSameRM(xar1)) {
   xar2.start(xid, XAResource.TMJOIN);
}


PLEASE NOTE THE EXCLAMATION MARK "!" IN THE IF CLAUSE

Enjoy
Back to top
View user's profile Send private message Send e-mail
binod
PostPosted: Sun Aug 14, 2005 6:59 pm    Post subject: Reply with quote

Novice

Joined: 05 Aug 2005
Posts: 19

Dear friend,

Please read carefullly.

The exclamation mark is not requred. Please see the explanation of TMNOFLAGS and TMJOIN below. Both are from XAResource.start() perspective.

TMNOFLAGS: When a TM finds an RM for the first time in the transaction, i.e. isSameRM with other XAResources is false, it will create a new transaction branch in the transaction and will call XAResource.start() wth this flag.

<code>
Xid id = getXIDOFTransaction(); // Since this is new, a new Xid will be created.
crateNewBranch(xid);
xar1.start(xid, XAResource.TMNOFLAGS)
</code>

TMJOIN: If a TM finds that the XAResource is from the same RM as one of the already enlsted in the same transaction, it will use TMJOIN and call XAResource.start with same branchID as the earlier one. This is to indicate RM to join the XAResource in its already existing branch.
<code>
boolean isequal = xar1.isSameRM(xar2);
if (isequal) {
Xid id = getExistingId(xar1);
// Dont create a new branch...
xar2.start(xid, XAResource.TMJOIN) // HANG
} else {
Xid id = getXIDOFTransaction(); // returns already existing tx.
crateNewBranch(xid);
xar2.start(xid, XAResource.TMNOFLAGS)
}
</code>

Note that there is a big dfference between *start with noflags* and *start with tmjoin". May be XA specs should have use TMRESUSE rather than TMJOIN. Unfortunately, specs have clearly indicated TMJOIN.

Bottom line is that meaning of TMJOIN is not as you think. And note, the above code is not written by me. That is inside TM of appserver.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 15, 2005 12:01 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

So If you displayed the code of the TM and you are not writing the TM what code are you using to get to this situation ?
Back to top
View user's profile Send private message Send e-mail
binod
PostPosted: Mon Aug 15, 2005 8:16 pm    Post subject: Reply with quote

Novice

Joined: 05 Aug 2005
Posts: 19

fjb_saper wrote:
So If you displayed the code of the TM and you are not writing the TM what code are you using to get to this situation ?


Please see my original post::

I wrote a resource adapter that sit in between TM and MQ series.

Can you answer to my real query regarding TMJOIN and why MQ series is behaving like this? Should I turn on some flag somewhere in MQ series to get a proper TMJOIN behaviour?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 16, 2005 10:33 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

The transaction manager is J2EE and will provide you with the current transaction....
The current transaction has a specific transaction interface:
commit()
delistResource(XARes res, int flag)
enlistResource(XARes res)
getStatus()
registerSynchronization(Synchronization sync)
rollback()
setRollbackOnly()


You want to provide an XAResource from the resource adapter....
I see you trying to reinvent the wheel (XAResource methods) ... wrong way to go about it.

Use JMS API
get an XAConnection and extract the XAResource from the XASession.

Done with XA support...!!

Enjoy
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Aug 16, 2005 10:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think he is trying to write the RA that the JMS API will use under the covers.

I can't help with this though.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
binod
PostPosted: Tue Aug 16, 2005 11:04 am    Post subject: Reply with quote

Novice

Joined: 05 Aug 2005
Posts: 19

fjb_saper wrote:
The transaction manager is J2EE and will provide you with the current transaction....
The current transaction has a specific transaction interface:
commit()
delistResource(XARes res, int flag)
enlistResource(XARes res)
getStatus()
registerSynchronization(Synchronization sync)
rollback()
setRollbackOnly()


You want to provide an XAResource from the resource adapter....
I see you trying to reinvent the wheel (XAResource methods) ... wrong way to go about it.

Use JMS API
get an XAConnection and extract the XAResource from the XASession.

Done with XA support...!!

Enjoy


I am not reinventing the wheel. Please http://genericjmsra.dev.java.net and then reply to my query. Your answer wont solve my problem
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 16, 2005 11:05 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

jefflowrey wrote:
I think he is trying to write the RA that the JMS API will use under the covers.

I can't help with this though.


Sure but the RA needs only to supply an XAResource to the WAS TM.
Now the XAResource can be extracted from the JMS API and need not be rewritten what he apparently is trying to do...

Enjoy
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Aug 16, 2005 11:11 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You're on linux, and trying to use MQ as the TM?

I remember some recent posts from wschutz... somewhere here... where he indicated that he thought this was not currently supported.

Also, you are running with the right threading model, correct?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
binod
PostPosted: Wed Aug 17, 2005 3:50 am    Post subject: Reply with quote

Novice

Joined: 05 Aug 2005
Posts: 19

jefflowrey wrote:
You're on linux, and trying to use MQ as the TM?

I remember some recent posts from wschutz... somewhere here... where he indicated that he thought this was not currently supported.

Also, you are running with the right threading model, correct?


Not really. As you said, I am providing a wrapper around (in the form of a JCA 1.5 adapter) JMS api so that any applicaton server (and their TM) can use any JMS provider (MQ series included) for both inbound and outbound transactions.
http://genericjmsra.dev.java.net

So, In my case, TM is appserver and MQ series is RM. I am just a middleman and suffering
Back to top
View user's profile Send private message
binod
PostPosted: Wed Aug 17, 2005 3:52 am    Post subject: Reply with quote

Novice

Joined: 05 Aug 2005
Posts: 19

fjb_saper wrote:
jefflowrey wrote:
I think he is trying to write the RA that the JMS API will use under the covers.

I can't help with this though.


Sure but the RA needs only to supply an XAResource to the WAS TM.
Now the XAResource can be extracted from the JMS API and need not be rewritten what he apparently is trying to do...

Enjoy


RA just wraps JMS api. XA Resource (of MQ series) is extracted from JMS api and is given to TM (of ANY appserver). Currently I am using Sun application server.
The only problem is MQ series' XAResource doesnt seem to conform to XA specifications.


Last edited by binod on Wed Aug 17, 2005 4:12 am; edited 1 time in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 17, 2005 3:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It wasn't clear who the TM was - to me.

It seems to be the call into the resource manager component of MQ that is hanging? Under what you think is a normal situation?

Or is it hanging inside your code, or in the j2ee api between your code and the MQ API?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
binod
PostPosted: Wed Aug 17, 2005 5:43 am    Post subject: Reply with quote

Novice

Joined: 05 Aug 2005
Posts: 19

jefflowrey wrote:
It wasn't clear who the TM was - to me.

It seems to be the call into the resource manager component of MQ that is hanging? Under what you think is a normal situation?
?


That is correct. The XAResource.start(xid, TMJOIN) on the XAResource of MQ series is hanging. I explained the situation multple times above. Thanks for understandng my issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next Page 2 of 3

MQSeries.net Forum Index » IBM MQ Java / JMS » MQSeries Issue/ Generic RA for JMS
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.