-
1. Re: Dedicated connection without connection pooling
vickyk Feb 17, 2008 11:42 PM (in response to chavali)"chavali" wrote:
Hi
How do I dedicate a connection per user through the session and have control on closure of the connection.
You need to use PoolByCri which can be configured by putting <application-managed-security> in the -ds.xml file
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJCACommon"chavali" wrote:
I am connecting to legacy c++ server port. When I close the connection the legacy system should know that the socket Id is closed and depending on this the legacy system will lot other jobs.
Pleae suggest if this possible through JCA or there is any alternative for this.
The Jboss JCA will call the cleanup() on the ManagedConnection where you can clean any client specific state maintained .
It is called from hereprotected void managedConnectionDisconnected(ConnectionListener cl) throws ResourceException { //if there are no more handles, we can return to pool. if (cl.isManagedConnectionFree()) returnManagedConnection(cl, false); }
http://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jboss/resource/connectionmanager/NoTxConnectionManager.java
You can find the similar call in this too
http://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jboss/resource/connectionmanager/TxConnectionManager.java -
2. Re: Dedicated connection without connection pooling
chavali Feb 18, 2008 1:27 AM (in response to chavali)Hi,
The exception we are getting is during the managed connection close to the backend EIS(legacy c++) system. Can you please help us in making the managed connection close to the backend system. Please help us in avoiding the problem.
We are using JBoss4.2.0-GA. Please help us.
We are getting the following exception after getting the response from the backend C++ server. We are not calling the connection.close() explicitly , but JBoss is trying to call the close connection and throwing the below exception.
BELOW IS THE COMPLETE STACKTRACE DURING OUR JCA use.
11:40:24,890 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: com.ericsson.jca.connector.impl.CSTAConnectionImpl@134d246
java.lang.Throwable: STACKTRACE
at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at com.ericsson.jca.connector.impl.CSTAConnectionFactoryImpl.getConnection(CSTAConnectionFactoryImpl.java:55)
at xlink.ConnectionCreation.getConnection(ConnectionCreation.java:39)
at xlink.MonitoringServicesServerMessageReceiverInOut.invokeBusinessLogic(MonitoringServicesServerMessageReceiverInOut.java:90)
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
11:40:24,890 INFO [STDOUT] in CSTAConnectionImpl.close-This is Synchronized method
11:40:24,890 INFO [STDOUT] in CSTAManagedConnection.close-This is synchronized method
11:40:24,890 INFO [NoTxConnectionManager] Unregistered handle that was not registered! null for managedConnection: com.ericsson.jca.connector.impl.CSTAManagedConnection@1664f1a
11:40:24,890 INFO [STDOUT] The application server has placed the connection back to the connection pool
Regards,
Chavali -
3. Re: Dedicated connection without connection pooling
vickyk Feb 18, 2008 1:46 AM (in response to chavali)We are not calling the connection.close() explicitly , but JBoss is trying to call the close connection and throwing the below exception.
The CacheConnectionValve is closing the connections for you , the message you are seeing is not the error .
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
If you don't close the connections yourself your application will land up with leaked connections thus making the system unresponsive due to unavailability of the connections.
You can remove the CacheConnectionValue configuration from the tomcat service.xml file , but make sure that your application does close the connections properly .
http://wiki.jboss.org/wiki/Wiki.jsp?page=CanJBossTellMeWhenIDontCloseAConnection