Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Bitronix Transaction Manager
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h1>Resource Loader</h1> <p>The Resource Loader is a facility that allows easy configuration and management of resources. Pools configured via the Resource Loader will be created automatically during the transaction manager's startup and will be closed during its shutdown.</p> <p>It consists of an extra layer above the JDBC and JMS pools which configures them via a properties file. It is not mandatory to use it but sometimes it is better than manually creating resource pools. Another good example of Resource Loader usage is when BTM is embedded in a servlet container which configuration file cannot easily be extended, like <a class="confluence-link" href="/display/BTM/Tomcat13" data-linked-resource-id="109478174" data-linked-resource-type="page" data-linked-resource-default-alias="Tomcat13" data-base-url="http://docs.codehaus.org">Tomcat</a> for instance.</p> <h4>Contents</h4> <img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3RvYzptYXhMZXZlbD0zfG1pbkxldmVsPTJ9&locale=en_GB&version=2" data-macro-name="toc" data-macro-parameters="maxLevel=3|minLevel=2"> <h2>Enabling the Resource Loader</h2> <p>You can enable it by setting the <code>bitronix.tm.resource.configuration</code> property in the <a class="confluence-link" href="/display/BTM/Configuration13" data-linked-resource-id="99909646" data-linked-resource-type="page" data-linked-resource-default-alias="Configuration13" data-base-url="http://docs.codehaus.org">configuration file</a> or by calling <code>setResourceConfigurationFilename()</code> on the <a href="http://btm.codehaus.org/api/1.3.3/bitronix/tm/Configuration.html">Configuration</a> object.</p> <p>This property must contain a path to a properties file that will be loaded by the Resource Loader to create pools. Its default value is <code>null</code> which means the Resource Loader is disabled and resources should be manually created via the API.</p> <h2>Configuring a JDBC pool</h2> <p>You can configure a JDBC connection pool that wraps the driver's <code>javax.sql.XADataSource</code> implementation and presents it to the user as a <code>javax.sql.DataSource</code>, much like with the API.</p> <p>To configure a JDBC pool, create a set of properties: </p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> - (A) .(B). (C) - resource.ds1.className=oracle.jdbc.xa.client.OracleXADataSource resource.ds1.uniqueName=oracle resource.ds1.maxPoolSize=5 resource.ds1.driverProperties.user=users1 resource.ds1.driverProperties.password=users1 resource.ds1.driverProperties.URL=jdbc:oracle:thin:@localhost:1521:XE </pre></td></tr></table> <p><code>(A)</code> is constant and never changes.<br /> <code>(B)</code> is an arbitrary name used to group a set of properties together.<br /> <code>(C)</code> is a javabean property of <a href="http://btm.codehaus.org/api/1.3.3/bitronix/tm/resource/jdbc/PoolingDataSource.html">bitronix.tm.resource.jdbc.PoolingDataSource</a>.</p> <p>Refer to the <code>PoolingDataSource</code> javadoc or to the <a class="confluence-link" href="/display/BTM/JdbcConfiguration13" data-linked-resource-id="111182496" data-linked-resource-type="page" data-linked-resource-default-alias="JdbcConfiguration13" data-base-url="http://docs.codehaus.org">JDBC configuration</a> page to know what properties can be set.</p> <h2>Configuring a JMS pool</h2> <p>You can configure a JMS connection pool that wraps JMS server's <code>javax.jms.XAConnectionFactory</code> implementation and presents it to the user as a <code>javax.jms.ConnectionFactory</code>, much like with the API or for JDBC.</p> <p>To configure a JMS pool, create a set of properties: </p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> - (A) .(B). (C) - resource.mq1.className=org.activemq.ActiveMQXAConnectionFactory resource.mq1.uniqueName=activemq resource.mq1.maxPoolSize=2 resource.mq1.driverProperties.userName=defaultUser resource.mq1.driverProperties.password=defaultPassword resource.mq1.driverProperties.brokerURL=tcp://localhost:61616 </pre></td></tr></table> <p><code>(A)</code> is constant and never changes.<br /> <code>(B)</code> is an arbitrary name used to group a set of properties together.<br /> <code>(C)</code> is a javabean property of <a href="http://btm.codehaus.org/api/1.3.3/bitronix/tm/resource/jms/PoolingConnectionFactory.html">bitronix.tm.resource.jms.PoolingConnectionFactory</a>.</p> <p>Refer to the <code>PoolingConnectionFactory</code> javadoc or to the <a class="confluence-link" href="/display/BTM/JmsConfiguration13" data-linked-resource-id="111182499" data-linked-resource-type="page" data-linked-resource-default-alias="JmsConfiguration13" data-base-url="http://docs.codehaus.org">JMS configuration</a> page to know what properties can be set.</p> <h2>Ant-like references</h2> <p>Unlike the transaction manager, the Resource Loader does not support ant-like references (<code>${...</code>}) in its configuration file.</p> <h2>JNDI binding</h2> <p>All resources created by the Resource Loader are bound to BTM's JNDI provider, just like the ones created by direct use of the API. Have a look at the <a class="confluence-link" href="/display/BTM/Jndi13" data-linked-resource-id="111182827" data-linked-resource-type="page" data-linked-resource-default-alias="Jndi13" data-base-url="http://docs.codehaus.org">Embedded JNDI provider</a> page for more details.</p> <p><img class="confluence-embedded-image confluence-external-resource" src="http://www.bitronix.be/images/shim.gif" data-image-src="http://www.bitronix.be/images/shim.gif"></p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced