I am trying to host a service on a JBoss. After starting the Jboss the first request to the service is always slow, and this seems to be because the getConnection call is taking time.
JBoss AS lazy-loads database connections. It will not make any connection until it receives the first connection request. When it receives one, it will establish min-connections before providing one in response to the request.
The typical answer to this is to write a startup MBean and have it request a database connection, then the time to establish the connections will become part of the AS startup time.
http://www.coderanch.com/t/90327/JBoss/Configuring-Startup-class