C O N N E C T I N G T O D A T A B A S E S A N D O T H E R R E S O U R C E M A N A G E R S
connection. IdleTimeoutMinutes indicates approximately how long a connection can be
unused before being discarded. This is especially useful if your driver closes unused
connections without telling you. Generally an idle connection should be removed within 1.5
* IdleTimeoutMinutes.
Finally, and very importantly, the criteria attribute indicates how the ConnectionManager
decides if two connections are interchangeable. You can usually get connections by either
getConnection() or by getConnection(userinfo). The former relies on the container to
manage security, the latter on the application. If you are using container managed security,
set the criteria to ByContainer: if you are using only application managed security, use
ByApplication. Do not use both with one ConnectionManager. If you are using default
user/password values specified in the ManagedConnectionFactoryProperties, or if your
adapter supports reauthentication, use ByNothing. Note that if you are using Application
managed security you must leave the SecurityDomainJndiName attribute empty to avoid
exceptions and general failure. If you can set other properties in your getConnection(stuff)
call, such as transaction isolation perhaps, you may need ByContainerAndApplication. Note
that the MinSize and MaxSize apply to each distinguishable set of connections. If you are
using ByContainer, and have 5 user identities, and a MaxSize of 10, you can get up to 50
connections, 10 per identity. Currently there is no support for a "global" MaxSize attribute.
If you are using a jdbc driver, you have two choices of jca jdbc wrapper. If your driver
supports only the Driver interface, use the jboss local jdbc.rar. If your driver provides an
XADataSource implementation, use the jboss xa.rar. Note that with the jboss xa.rar, one of
the ManagedConnectionFactoryProperties is a semicolon separated list of name=value pairs
for the XADataSource properties of your driver. As of this writing, the xa wrapper has some
problems if you hold connections over calls to other ejbs or if you attempt to hold connections
between method calls.
Examples for popular databases are provided in the docs/examples/jca directory.
Deployment of your adapter configuration
If you are deploying a wrapped database driver, put the driver jar in lib or use a classpath
element to force its loading before the mbean deployment. With the current system, the
depends elements will force the resource adapter module (rar) to be deployed before your
ConnectionManager configuration. So: make sure the driver.jar, if required, is in lib, deploy
the rar by copying it to deploy, and deploy the ConnectionManager mbeans by copying the *
service.xml file to deploy. Don t forget that you need to set up security information in login
conf.xml.
100
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved