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>FAQ</h1><p><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"></p><h2>How/why/when did the project get started ?</h2><p>The BTM project started early 2005. Back in time I needed a XA capable transaction manager at many different occasions but couldn't find any satisfying all my needs: standalone, stable, actively maintained, production usable, open source. Unfortunately there were only two choices: JOTM and Tyrex which both were unusable for production as they lacked recovery (and more).</p><p>So I started working on BTM in my spare time until JBoss acquired Arjuna's product and released it as open source at the end of 2005. I thought that would be the end of my project but their product's usability was far from satisfying at the time so I just went on coding BTM.</p><p>By mid-2006, I finally had something usable that I thought was worth showing the world. It took another six month and eleven releases (archived here: <a class="external-link" href="http://www.bitronix.be/Btm/Download" rel="nofollow">http://www.bitronix.be/Btm/Download</a>) before I considered BTM was up to my needs. During that period, a small but faithful community of users appeared and encouraged me to continue working on BTM. <em>Thanks for that, guys !</em></p><p>About the same story as for Arjuna repeated at the end of 2006 when Atomikos released their impressive product as open source. But BTM already had a community and some users were already planning to go to production with BTM and waited for version 1.0 to be released.</p><p>Just before version 1.0, BTM migrated from a all-on-my-own-pc-and-my-website development environment to CodeHaus. This helped a lot making the project way more open to the community as well as providing me with free access to very much needed tools. <em>Thanks for that, guys !</em></p><h2>Why would I need a transaction manager ?</h2><h4>To use JDBC and JMS together</h4><p>If you either use two databases (or more) in your application or you use both a database and JMS then you <em>need</em> a transaction manager. Some people will argue that you can do without one even if you fall in on of those two cases. They are true: <em>it is</em> possible to have a transaction span two resources (like JMS and JDBC) by writing so-called <strong>idempotent</strong> methods manipulating these resources and some simple error recovery logic.</p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Idempotent methods" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9SWRlbXBvdGVudCBtZXRob2RzfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>The Wikipedia definition of idempotent is: <em>A unary operation is idempotent if, whenever it is applied twice to any element, it gives the same result as if it were applied once.</em></p><p>Idempotent methods can be called as many times as you want without doing anything different than if they were only called once.</p></td></tr></table><p>The fact is that it is harder to write idempotent methods (when it is possible at all) and you also have to write some recovery logic to handle crash cases. It is more or less easy to write code that makes sure the information gets registered at least once. Idempotent methods make sure that in case they got called twice (because of a retrial after a crash) data will be safe anyway.</p><p>Why would you have to accept those constraints when you can get free of them ? And why would you have to be careful about low-level logic in your code when you can delegate it to an component specialized in this task ?</p><p>Would you write your own web framework or your own ORM nowadays ? Neither would I. It is the transaction manager's job to make sure atomicity is kept across multiple resources, not yours.</p><h4>To use database shards</h4><p>Shards is a new database design that started making noise recently. The basic idea is to divide your data between multiple cheap servers, each one handling a small fraction of your data. If you want to know more about shards, read <a href="http://technoroy.blogspot.com/2008/07/shard-database-design.html">this article</a>.</p><p>There are at least two implementations of JPA that support shards: <a href="http://people.apache.org/%7Eppoddar/slice/site/index.html">OpenJPA using Slice</a> and <a href="http://www.hibernate.org/414.html">Hibernate using Hibernate Shards</a>.</p><p>The first one explicitly states that XA is required to maintain atomicity between all nodes while Hibernate does not explicitly document this but the developers openly agreed that XA also is a prerequisite to atomicity, see <a class="external-link" href="http://groups.google.com/group/hibernate-shards-dev/browse_thread/thread/a1bf86180f6ecf63" rel="nofollow">http://groups.google.com/group/hibernate-shards-dev/browse_thread/thread/a1bf86180f6ecf63</a> and <a class="external-link" href="http://opensource.atlassian.com/projects/hibernate/browse/HSHARDS-49" rel="nofollow">http://opensource.atlassian.com/projects/hibernate/browse/HSHARDS-49</a>.</p><h2>Why using BTM and not <em>insert another TM here</em> ?</h2><p>In short: because it is complete and easy to use.</p><p>BTM has been tailored to support only the most common scenarios: XA with JDBC and / or JMS. It's internal logic is kept as simple as possible to only support them. On the other hand, great care has been taken to make those scenarios working as best and as easily as possible. BTM also fully supports crash recovery thanks to its disk logger.</p><p>You might need more than what BTM proposes, like JCA Connectors support or JTS. In that case you should look at other available products.</p><h2>Why is BTM 1.2 refusing to start when configured with Oracle while 1.1 works fine?</h2><p>See next question. You should also know that there was a bug in version 1.1 that allowed BTM to start up even when a resource could not be recovered (<a href="http://jira.codehaus.org/browse/BTM-2">BTM-2</a>). This bug has been fixed in version 1.2.</p><h2>Why is Oracle throwing a XAException during initialization of my datasource?</h2><p>BTM tries to recover all resources during startup. If it fails on one of them, it will refuse to start and throw this exception:</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>Caused by: bitronix.tm.recovery.RecoveryException: error running recovery on resource myResourceUniqueName (XAER_RMERR) at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:168) at bitronix.tm.recovery.Recoverer.run(Recoverer.java:106) at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:47) ... 28 more Caused by: javax.transaction.xa.XAException at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:715) at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:231) at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:194) at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:164) </pre></td></tr></table><p>Oracle resources can only be recovered when the configured user has these privileges:</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>grant select on sys.dba_pending_transactions to myUser; grant select on sys.pending_trans$ to myUser; grant select on sys.dba_2pc_pending to myUser; grant execute on sys.dbms_system to myUser; </pre></td></tr></table><h2>Is there a way to avoid granting execute privilege on sys.dbms_system to be able to use Oracle ?</h2><p>Yes. Oracle 11g release 1 does not require this privilege anymore. It seems that Oracle also has a patch to backport this functionality to previous versions of the database (bug 5945463). Details about which versions can be fixed by this patch hasn't been disclosed and it is also not possible to freely download it, you have to contact Oracle support to get your hands on it.<br /> See: <a href="http://docs.oracle.com/cd/B28359_01/java.111/b31224/xadistra.htm#sthref1311">http://docs.oracle.com/cd/B28359_01/java.111/b31224/xadistra.htm#sthref1311</a></p><h2>Can BTM run in a cluster ?</h2><p>BTM can run in multiple virtual machines working on the same resources in parallel but you must remember to enable currentNodeOnlyRecovery in the configuration when doing so. <a class="confluence-link" href="/display/BTM/ImplementationDetails#ImplementationDetails-currentNodeOnlyRecovery" data-anchor="currentNodeOnlyRecovery" data-linked-resource-id="72417346" data-linked-resource-type="page" data-linked-resource-default-alias="ImplementationDetails#currentNodeOnlyRecovery" data-base-url="http://docs.codehaus.org">See here to know why</a>.<br /> <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