3 Replies Latest reply on Jul 9, 2013 2:24 AM by Wolf-Dieter Fink

    SLSB method not working as per expectaions

    Amol Joshi Newbie

      Hi all.

      We had developed an application using Struts2.1.8,EJB3.0,MS SQL Server 2005.  Application runs on JBoss4.2.2GA in all Dev,QA,Prod env. As we are using EJB, we expect either the whole operations in method should commit or none of them.  But we are facing issue that some operations in EJB method are getting committed to database while some of them not. We have not mentioned any transactional attribute on EJB methods, we are using jtds-1.2.5 driver for database communications. Also no exception handelling is done in EJB method, all arised exceptions are propogated to Struts and handelled thereover. Issue arises only on Prod evironment.  Can we get some assistance which could show the way for further investigation.

        • 1. Re: SLSB method not working as per expectaions
          Wolf-Dieter Fink Master

          As you say it run in different environments, does it fail for all or work in some? In that case I suppose a configuration issue.

          Does you set autocommit for the datasource, set explicit to false as it should not enabled.

           

          - are you sure that the transaction annotations are the same for all environments, if there is no one the default is "required"

          - are the data written to the db in any case, maybe the uncommitted data is never going to the db

          - in case of Exception handling the problem might that checked Exceptions do not rollback (RuntimeEx do a rollback) the Tx

          • 2. Re: SLSB method not working as per expectaions
            Amol Joshi Newbie

            Hi Fink. Thanks for your reply.

             

            Everythings works fine in Dev and QA env but issue appears only on Prod env.

            We have checked  'persistance.xml' file. No configuration property related to 'autocommit' is defined there.

            Transaction attributes are same for all environments.

            We are looking against checked exceptions as per your suggestion.

            • 3. Re: SLSB method not working as per expectaions
              Wolf-Dieter Fink Master

              I'm not sure, but it might be that the connection/database use autocommit by default in same case. Maybe on DB setup or (different) jdbc driver.

              You might check that with a simple app and a debugger to stop between two actions.