6 Replies Latest reply on Oct 11, 2007 9:36 AM by Dipali K

    Arjuna JDBC

    Dipali K Newbie

      In the programmers guide I found the following statement :=
      'The JNDI URL must be pre-pended with jdbc:arjuna: in order for the ArjunaJDBC2Driver to recognise that the DataSource must participate within transactions and be driven accordingly.'

      I am using Spring to POC for a 2PC commit, and I am confused as to where exactly I should be appending the 'jdbc:arjuna:' .
      I have 2 -ds.xml files deployed with XA-Resources defined and the spring config is as follows :
      <jee:jndi-lookup id="oracleDataSource2" jndi-name="ds/OracleDS2" />
      <jee:jndi-lookup id="oracleDataSource" jndi-name="ds/OracleDS" />

      Where should the 'jdbc:arjuna' prefix be ?

        • 1. Re: Arjuna JDBC
          Jonathan Halliday Master

          You probably don't need it, it's for standalone use. With Spring, you just configure the tx manager and the framework should do the rest.

          http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossTransactionsWithSpring

          your datasources will need to be XA though.

          P.S. well done for reading the docs before posting.

          • 2. Re: Arjuna JDBC
            Dipali K Newbie

            I did assume that would be the case, that Spring should handle it , but I saw a very strange behavior in that :

            I found that the transactions do happen but for some reason there is a huge delay in commit, upwards of 15 minutes ! I have no idea why this happens ..any clues ?

            That is why I was trying to see if I get to work outside the container ..but facing the below issue..

            • 3. Re: Arjuna JDBC
              Jonathan Halliday Master

              No idea on the commit delay. Send me a test case, I'll take a look.

              • 4. Re: Arjuna JDBC
                Dipali K Newbie

                Thank you for looking into this.

                Im sorry , but Im not sure how I should send a test case. Can I send a deployable archive (ear) .
                My app is a jax-ws spring based web service calling 2 different DAO operation s , internally using JDBCTemplate to write to 2 different databases.



                • 5. Re: Arjuna JDBC
                  Jonathan Halliday Master

                  A big blob won't do much good. I need source and a way to build it, plus config files etc. Strip your app down to the simplest possible version that reproduces the issue and send me the pieces (src, build script, config files) with documentation of the pre-requisites i.e. versions of java, jboss, spring etc

                  • 6. Re: Arjuna JDBC
                    Dipali K Newbie

                    I removed the webservice layer from the picture , instead the spring pojo service is being invoked from a servlet now. The commit is instantaneous but I am unable to get the rollback working.

                    The code is something like

                    add(){

                    DAO1.operation();
                    DAO2.operation();
                    throw new RuntimeException();
                    }

                    As I understand , this should rollback the db operations by default. Or do I need to specify explicitly ? Even if I do specify explicitly it only rollbacks the DAO2 db operation. It seems its treating the 2 db operations as 2 different transactions and not 1 as I expect it to be..

                    Any ideas ?