5 Replies Latest reply on Jul 15, 2010 10:06 AM by Mauro Molinari

    How to start with JBoss Transactions

    Michal Szymanski Newbie

      Hi

      During our project we develop WebServices using Axis2 , Tomcat and Postgres, because we have data on several daabases we have to use Transacion Manager. Our first choise was Atomikos but we found that there are some problems with Postgres and that is why now we are evaluating JBoss.

      The biggest problem with Jboss Transacion is that I cannot find documentation for beginers (Atomikos was very easy to install and use), I'm looking for easy tutorial how to use Jbos for standalone application and how to deply Jboss for application that uses Tomcat (and how to use DB pools), how to use it when I have JDBC connections. One of the first and probably stupid quastion that I have is should we start Jboss Transaction in some way to use it or it is enough if use jars in my programs? There are some starting scripts like

      start-recovery-manager.bat or start-transaction-service.bat and I do not know what for are these scripts? I've tried to start start-transaction-service.bat and I've got

       

      2010-06-07 16:27:57,171 [main] FATAL com.arjuna.orbportability.logging.loggerI18N - [com.arjuna.orbportability.orb.core.ORB.u
      nsupportedorb] ORB specific class creation failed - unable to find supported ORB
      Exception in thread "main" java.lang.ExceptionInInitializerError: [com.arjuna.orbportability.orb.core.ORB.unsupportedorb] ORB
      specific class creation failed - unable to find supported ORB
              at com.arjuna.orbportability.orb.core.ORB.initialise(ORB.java:164)
              at com.arjuna.orbportability.orb.core.ORB.<init>(ORB.java:62)

       

      Regards

      Michal Szymanski

        • 1. Re: How to start with JBoss Transactions
          Michal Szymanski Newbie

          Regarding ORB specific class creation failed - unable to find supported ORB I've found   http://community.jboss.org/message/512966  and I've commented com.arjuna.ats.arjuna.recovery.recoveryActivator_1 but I still has the same error

          • 2. Re: How to start with JBoss Transactions
            Michael Musgrove Master

            I don't have the anwers to all of your questions but here's something to get you started:

             

            The scripts start-recovery-manager.bat or start-transaction-service.bat are for running the transaction and recovery services in a distributed environment without an application server. For this you will need the JTS version of the JBossTS transaction product (it comes in two flavours). The documentation set describes the JTS.

             

            Personally, I would suggest if you really do want to use a transaction manager in a distributed environment then just run it inside an application server. But I suspect you just want local transactions.

             

            Why can't you use the Tomcat running in the JBoss app server - that already has the JBossTM integrated. These days hardware is fast enough that running an App Server is not a big deal resource wise.

             

            If you really do want to use JBossTM with a standalone Tomcat then we do have an unsupported integration. The readme is quite enlightening: http://anonsvn.jboss.org/repos/labs/labs/jbosstm/workspace/jhalliday/tomcat-integration/README.txt

             

            Hope this helps to get you started.

            • 3. Re: How to start with JBoss Transactions
              Michal Szymanski Newbie

              >Why can't you use the Tomcat running in the JBoss app server - that  already has the JBossTM integrated. These days hardware is fast enough  that >running an App Server is not a big deal resource wise.

               

              I think it is best solution for us. As I uderstand we can you JbossTM functionality without using EJB, am I right? At least for the begining we would like to use JBossTM with 'plain' JDBC, other words we would like to write in our systems something similar to this:

              UserTransactionManager
              utm=new UserTransactionManager();
              utm.init();
              utm.begin();
              Connection conn = ds.getConnection();
              <operations on DB>
              conn.close();
              utm.commit();

               

              Simply for the begining we would like to use local transactions and afterm maybe use Spring.

              Sorry that my questions are quite stupid but I've just  returned to Java after few years of break

               

              Michal Szymanski

              http://techblog.freeconet.pl

              http://blog.szymanskich.net

              • 4. Re: How to start with JBoss Transactions
                Michael Musgrove Master
                I think it is best solution for us. As I uderstand we can you JbossTM functionality without using EJB, am I right? At least for the begining we would like to use JBossTM with 'plain' JDBC, other words we would like to write in our systems something similar to this:

                UserTransactionManager
                utm=new UserTransactionManager();
                utm.init();
                utm.begin();
                Connection conn = ds.getConnection();
                <operations on DB>
                conn.close();
                utm.commit();

                 

                You can write code like that using servlets or with POJOs if you are using JBoss 5. Surely at some point you will need to move your code into a container of sorts.

                • 5. Re: How to start with JBoss Transactions
                  Mauro Molinari Novice

                  In my team we have embedded JBossTS into our webapp. This webapp is usually run in Tomcat. The task is not easy, however it's possible.

                   

                  I suggest you do the following:

                  - download JBossTS full distribution

                  - start to read docs in atsintegration (IntegrationGuide.pdf)

                  - then read all the guides in ArjunaCore and in ArjunaJTA

                   

                  ArjunaCore explains how the core of JBossTS works and many of the concepts will apply to JDBC transactions too.

                  ArjunaJTA should be more specific for the use of JBossTS with JTA.

                   

                  Mauro.