| Author | 
		  Message
		 | 
		
		  | MABeatty1978 | 
		  
		    
			  
				 Posted: Tue Oct 13, 2015 5:43 am    Post subject: endmqm -w while application is connected | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 17 Jul 2014 Posts: 54
  
  | 
		  
		    
			  
				I've got an application that starts up a thread the thread has a queue get with MQGMO = fail if quiescing. If I do a endmqm -w to the qmgr, the thread identifies the mqrc 2161 and returns to the main program.  However, it doesn't seem like the qget actually releases as the endmqm -w never ends the qmgr, I have to do a -i to get it to stop.
 
 
How do I get that to break so that if the qmgr is shutdown with a -w will actually shut the qmgr down. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Tue Oct 13, 2015 5:51 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				The program needs to actually close the MQCONN when it gets the MQRC. _________________ chmod  -R ugo-wx / | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | MABeatty1978 | 
		  
		    
			  
				 Posted: Tue Oct 13, 2015 6:12 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 17 Jul 2014 Posts: 54
  
  | 
		  
		    
			  
				
   
	| mqjeff wrote: | 
   
  
	| The program needs to actually close the MQCONN when it gets the MQRC. | 
   
 
 
 
I was closing the MQCONN, or at least I thought I was.
 
 
It seems qmgr.close(); doesn't achieve the desired results
 
 
but...
 
 
qmgr.disconnect(); does.
 
 
Any insite as to why?  what's the difference between MQQueueManager.close() and MQQueueManager.disconnect();
 
 
The documentation isn't very clear:
 
 close
 
 
public void close()
 
           throws MQException
 
 
    Closes the object. No further operations on this object are permitted after it is closed. The behaviour of the close method can be altered by setting closeOptions. 
 
 
vs....
 
 
 disconnect
 
 
public void disconnect()
 
                throws MQException
 
 
    Ends the connection to the queue manager. All open queues and processes accessed through this queue manager are closed and become unusable. The only way to reconnect is to create a new MQQueueManager object. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Tue Oct 13, 2015 6:25 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				close does what it says - it closes THE OBJECT.  
 
 
That is, it locks the properties and methods of the object so they can't be used again.
 
 
That doesn't cause the object to do anything. _________________ chmod  -R ugo-wx / | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | exerk | 
		  
		    
			  
				 Posted: Tue Oct 13, 2015 6:27 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 02 Nov 2006 Posts: 6339
  
  | 
		  
		    
			  
				You normally CLOSE an OPEN but DISCONNECT a CONNECT    _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |