| Author | 
		  Message
		 | 
		
		  | neocruz | 
		  
		    
			  
				 Posted: Mon Sep 13, 2004 8:18 am    Post subject: UOW per Connection | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 13 Jun 2004 Posts: 54
  
  | 
		  
		    
			  
				Is is possible to open multiple queues and issue puts and gets under syncpoint with one MQCONN or do I have to open a seperate MQCONN per queue due to all the units of work?
 
 
Thanks,
 
Rich | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bower5932 | 
		  
		    
			  
				 Posted: Mon Sep 13, 2004 8:27 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA 
  | 
		  
		    
			  
				| You can use the single MQCONN for the multiple MQGETs/MQPUTs.  You'll end up with all of your messages committed/backed out at the same time. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | neocruz | 
		  
		    
			  
				 Posted: Mon Sep 13, 2004 8:37 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 13 Jun 2004 Posts: 54
  
  | 
		  
		    
			  
				Thanks. What I was thinking was: (pseudo code)
 
 
connect to Qmgr
 
 
open queue 1
 
open queue 2
 
open queue 3
 
 
all is done under syncpoint
 
 
put to queue 1
 
if RC is 0, then mqcmit
 
 
put to queue 2
 
if RC is 0, then mqcmit
 
 
 
get from queue 3
 
if RC is 0, then mqcmit
 
 
close all queues
 
disconnect from Qmgr
 
 
Is it not possible to do it this way? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bower5932 | 
		  
		    
			  
				 Posted: Mon Sep 13, 2004 10:33 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA 
  | 
		  
		    
			  
				You can definitely do it your way.  My comment about all of them being done together was:
 
 
MQPUT to Q1 in UOW
 
MQPUT to Q2 in UOW
 
MQGET from Q3 in UOW
 
 
CMIT/BACK - this will commit/backout all three messages.  
 
 
I was looking at your question as wanting to do everything at once rather than separately. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | neocruz | 
		  
		    
			  
				 Posted: Mon Sep 13, 2004 11:00 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 13 Jun 2004 Posts: 54
  
  | 
		  
		    
			  
				Yeah I went back and read it again and worded it wrong. Okay so now let me expand on this a little.
 
 
The application will connect to the qmgr and issue puts and gets to 3 different queues. I'd like this accomplished under syncpoint for each one. They are all seperate and have really nothing to do with each other.  I'd like to commit or backout each one without affecting the other put or get. Can I do that with one MQCONN or does a MQCMIT commit everything in that MQCONN? I guess that is my real question. If it does, then I'll have to MQCONN three seperate times to retain individual transactions.
 
 
Sorry. It's a little hard for me to put stuff on paper sometimes.
 
 
Rich | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Mon Sep 13, 2004 11:06 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				Connect
 
Open queue 1
 
put
 
commit
 
close queue 1
 
open queue 2
 
put
 
commit
 
close queue 2
 
open queue 3
 
get
 
commit
 
close queue 3
 
disconnect _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | neocruz | 
		  
		    
			  
				 Posted: Mon Sep 13, 2004 11:28 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 13 Jun 2004 Posts: 54
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |