This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Let us asssume the scenario, the application server establish the communication with EIS environment by an (RA) Resource Adapter.The communication only carried by way of sockets.The Resource Adapter ManagedConnectionFactory helps to establish the connection in between Application server and listening agent(Which is running one side, to listen the connections). When RA started by AS, RA creates the connectionfactory objects. The default max connections has to be created inside the connection pool by connection manager of application server. In my case the deafult max connection size is 6. These are all ManagedConnections in Application Server context.When RA wants to do communication with EIS means, the RA asks for connection to AS. The AS checks the Pool for connection availablity , in our case we are having 6 Managed Connection objects we have. So AS gave the one Managed Connection objects for the EIS operation to RA. This managed connection is responible for current communication.A single connection establish the communication to that EIS specifc socket. The usual behaviour is the connection has to be returned into pool after its particular usage.
The AS once established its connection to the EIS, in case the Application shut down if we call, these connection objects are flushed out. that means destoyed at the time of AS shut down (you could see the below logs.) The AS shut down call, the before destoying the entire pool,it is checking for connection which is in already locked. that means handle remains.below you see in hanlde, there is an handle ,which is unreleased . My doubt is here goes the AS responisbilty to instruct the RA to close the all resource hanldes which are in preovious communication with socket. The AS checks for it , it will mark it as a DESTROY state.
Flush marking checked out connection for destruction
it will just mark the connection as DESTROY, but it won't give the connections to RA, which must be closed by RA. but the AS instructs the RA to what are the connections which are not in communication, that is out of 6 ,only it supply 6 connection objects to be closed by RA. Not that one , which must be closed during the Flushing process.
My question is why it won't close that connection which is already set with DESTROY state.? Please anyone know anything about this share with me.
2012-02-13 16:19:31,037 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=jca/myConnectionFactory' from JNDI name 'java:jca/myConnectionFactory'
2012-02-13 16:19:31,058 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' from JNDI name 'java:JmsXA'