3 Replies Latest reply on Aug 21, 2007 6:28 AM by jhalliday

    Long-running transactions for web service clients

    chrholm

      Hi

      For one of our customers we have developed a series of webservices to access our system. To test the new webservices, I have created a series of unittests, which in themself, work just fine.

      They run on JBoss 4.0.5.GA with WS 2.0.1.GA.

      For testing purposes, it is very convinient to be able to rollback everything that was done during the test. This way you dont have to worry about clean-up, and the tests can be run any number of time with the same result.

      I have however not been able to find a way to do that using the current JBoss Transactions. Deploying the tests in a servlet container is not an option. It is very important for us to be able to run tests quickly, and having to wait for an ear-deployment is far from quick enough.

      I have made it so our webservices can be deployed in a test-mode, where each call to the webservice is rolled back, but this prevents us from doing anything but very simple testcases, as everything is rolledback after each call.

      What I would like to have is a way to demarcate transactions from the client side. Any ideas on how I can achieve this?

        • 1. Re: Long-running transactions for web service clients
          jhalliday

          > Deploying the tests in a servlet container is not an option. It is very important for us to be able to run tests quickly, and having to wait for an ear-deployment is far from quick enough

          I'm not clear on why deployment and running are linked in this way. Deploy once, run as many times as you like without the overhead of redeploying?

          • 2. Re: Long-running transactions for web service clients
            chrholm

            AFAIK the tests have to be running inside a servlet container, and unless you resort to some fancy classloading, that would mean a redeployment of the tests after each change.

            The reason we so dislike the redeployment scenario, is that it severly slows down the code-test-fix cycle (of the test-cases).

            • 3. Re: Long-running transactions for web service clients
              jhalliday

              Servlet reloading should be small overhead compared to the total test execution time and especially compared to the code writing and compilation steps. The container needs to reload only the modified class, not redeploy the entire webapp.

              BTW, how is the state of your services represented? EJBs?