1 2 Previous Next 29 Replies Latest reply on Nov 27, 2006 6:25 PM by rupertlssmith Go to original post
      • 15. Re: Does JBoss Transactions throw exception on more than one
        weston.price

        Otherwise known as the 'Ostrich Transaction Strategy'

        Put your head in the sand and hope for the best!

        • 16. Re: Does JBoss Transactions throw exception on more than one
          weston.price

          Actually, this has some pretty dramatic effects as deploying multiple LocalTX resources in JBoss was pretty common.

          • 17. Re: Does JBoss Transactions throw exception on more than one
            kconner

            This is something that should be discouraged. Extending normal 2PC to include a single 1PC resource can be done whilst keeping the correct 2PC semantics, including more than one will break this.

            • 18. Re: Does JBoss Transactions throw exception on more than one
              weston.price

               


              This is something that should be discouraged.


              I agree, but what we are effectively saying is that we no longer support using multiple LocalTx resources which is not trivial for quite a few reasons.

              1) We always supported it before and now we are 'revoking' functionality
              2) Now we are effectively forcing the use of XA on people if they want to use JBoss/JCA beyond the trivial case of one XAResource and one LocalTxResource

              I can already think of cases where this is going to be a bit touchy due to the resource limitations of some of the DB/JMS vendors. This is to say nothing of the extra cost sometimes associated with XA implemenations (aka WebSphereMQ) or lack of XA funcationality (Postgres).



              • 19. Re: Does JBoss Transactions throw exception on more than one
                kconner

                I prefer to think about adding functionality, i.e. recovery :-).

                Your trivial case should also include any number of XAResources when coupled with a single LocalTxResource. It is multiple LocalTxResources which are the issue.

                If this is going to be a serious problem then we need to talk about it, although this would mean that we would be losing the guarantee that recovery/2PC gives.

                In any case we should continue this discussion somewhere else and not hijack this posting.

                • 20. Re: Does JBoss Transactions throw exception on more than one
                  weston.price

                   


                  I prefer to think about adding functionality, i.e. recovery :-).


                  Again, I agree. I will give you 10 dollars if you don't say the word 'recovery' in this post again.


                  Your trivial case should also include any number of XAResources when coupled with a single LocalTxResource. It is multiple LocalTxResources which are the issue.


                  Yes, a keen grasp of the obvious ;-) But again, what if I don't want to use XA or, more importantly, my company can't afford XA. Now what you are saying is that I effectively can't use JBoss with JBossTS. Similarly, I now can't use multiple Postgres datasources (due to some implementation issues in their driver), or any other scenario that requires multiple LocalTX resources.


                  In any case we should continue this discussion somewhere else and not hijack this posting.


                  Fine.




                  • 21. Re: Does JBoss Transactions throw exception on more than one
                    weston.price
                    • 22. Re: Does JBoss Transactions throw exception on more than one
                      kconner

                       

                      I will give you 10 dollars if you don't say the word 'recovery' in this post again.

                      When can I collect :-)

                      • 23. Re: Does JBoss Transactions throw exception on more than one
                        weston.price

                        Sorry, your cut-n-paste did you in as it contains the word recovery...

                        Sucker ;-)

                        • 24. Re: Does JBoss Transactions throw exception on more than one
                          kconner

                          Ah, but those were your words and not mine :-)

                          • 25. Re: Does JBoss Transactions throw exception on more than one
                            marklittle

                             

                            "Kevin.Conner@jboss.com" wrote:
                            I prefer to think about adding functionality, i.e. recovery :-).

                            Your trivial case should also include any number of XAResources when coupled with a single LocalTxResource. It is multiple LocalTxResources which are the issue.

                            If this is going to be a serious problem then we need to talk about it, although this would mean that we would be losing the guarantee that recovery/2PC gives.

                            In any case we should continue this discussion somewhere else and not hijack this posting.


                            +1

                            Recovery is a critical part of ACID transactions. If you're trying to put more than one one-phase aware resource into a 2-phase transaction then you should look at whether you really need a global transaction. JBossTS provides full ACID semantics. It supports Last Resource Commit Optimisation, but as Kev pointed out, this is for a SINGLE 1-phase aware resource. JBossTM may not have this "limitation", but it may also be encouraging unsafe approaches to using "transactions". I would suggest looking again at the requirement.

                            • 26. Re: Does JBoss Transactions throw exception on more than one
                              rupertlssmith

                              My post seems to have triggered a little spat!

                              For my part, I'm very glad that JBossTS fully supports ACID. If I were happy with the ostrich, head-in-the-sand approach, I probably would not even have bothered to attempt to write a JCA wrapper around my resource. I did that to enable to me to hook into transactions properly, and to take every care not to end up with two persistent resources entering an mutually inconsistent state (by heuristic commit/rollback).

                              I would suggest that JBossTS should fail (i.e. it is behaving correctly at the moment) if more than one local tx resource is used. If it needs to support the 'fake' XA mode of JBossTM for backward compatibility, maybe a configuration switch should be added to turn that on?

                              Yes, XA has its costs: 2N + 1 disk synchs for N resource writes. Which is why some little cogs are turning in the back of my mind somewhere, thinking how best to implement the disk synchs for my resource. Luckily for me its a resource that is only read from most of the time.

                              Thanks for your replies. I will try deploying two local tx resources for things other than my JCA wrapper and see how JBossTS likes that, just out of curiosity. It is not at all unlikely that my JCA wrapper implementation is incorrect and is the source of the error message that I see.

                              P.S. It is very difficult to find hard information about how to implement an XA capable JCA wrapper. Books on JCA mostly seem to avoid the tricky issue of transactions. Once I've got mine working I intent to write an article explaining how to do it.

                              • 27. Re: Does JBoss Transactions throw exception on more than one
                                kconner

                                 

                                "rupertlssmith" wrote:
                                My post seems to have triggered a little spat!

                                This is not a spat, this is normal banter between us :-).
                                "rupertlssmith" wrote:
                                P.S. It is very difficult to find hard information about how to implement an XA capable JCA wrapper.

                                Weston is definitely the right person to ask ;-)

                                • 28. Re: Does JBoss Transactions throw exception on more than one
                                  rupertlssmith

                                   

                                  This is not a spat, this is normal banter between us :-).


                                  Hehe. I like to call it 'creative tension'.

                                  • 29. Re: Does JBoss Transactions throw exception on more than one
                                    rupertlssmith

                                    Sweet. I changed my database driver to an XA capable one. Now things run just fine with my one local tx JCA wrapper and the db using the last resource trick. Nice one JBoss.

                                    Still planning on adding full XA support to my JCA wrapper though.

                                    1 2 Previous Next