6 Replies Latest reply on Aug 1, 2003 1:31 AM by speedy_omen

    Data Updations are not happening

    ganesh Newbie


      I am new to JBoss and i am facing a peculiar problem. I had created a datasource in the jboss.jcml file
      and am using this datasource directly through my JSP i.e i lookup the datasource ,get a connection,executing the statement, close the connection etc.

      If i try to update a record in the database, it is not happening. i.e after I update this record thru my JSP and view this result using a SQL client it does not get reflected.

      Updations happens only after i have shutdown the app server.


        • 1. Re: Data Updations are not happening
          Hermann RANGAMANA Newbie

          Hi Ganesh,

          What database are you using? Some database require closing the connection after **each** request in order to have the change propagated into the database. Otherwise, have a look at commit options. You're seemingly using commit options A. Set it into Commit options B, or C ...

          Enjoy coding


          • 2. Re: Data Updations are not happening
            ganesh Newbie


            I am using Oracle 8i as my database .
            I am also closing the connection after each request.

            Also where do i set the Commit options ? Is it in
            the jboss.jcml file ?

            I had tried a workaround which worked,though I am not sure if it is the right approach.It involved using "con.setAutoCommit(true)" after getting the connection.

            Thanks and Regards

            • 3. Re: Data Updations are not happening
              David Jencks Master

              If you are accessing the datasource directly from a jsp or servlet or mbean you are not participating in the ejb containers transaction management. So you have to manage transactions yourself. One way is by setting autocommit(true), although if you also use these connections from ejbs you will have to remember to set it false before you return. Another possibility is to call commit() on the connection before closing it.

              • 4. Re: Data Updations are not happening
                Erik Sliman Apprentice

                My problem may be the same as yours. I've been hitting my head trying to figure out why I have transaction deadlocks. Basically, I can view and update, but when I try to create, I get a transaction deadlock.

                I have the problem both with MySQL and SQL Server. I thought I solved the problem with SQL Server, but then noticed that it never seemed to commit the changes. I can update and add lots of data, only to find when I shut down and restart JBoss, none of it was saved.

                This explains my deadlock problem. If it is never commiting, then naturally a transaction deadlock can occur. Does anyone have any idea why it wouldn't commit?

                I switched to commit-option B to solve an earlier problem, from A. I tried every transaction isolation option available. I originally had the trans-attribute for all methods set to Required, later changing it to match a BMP example.

                In the example, all Home methods were set to "NotSupported". Setting the create to "Required" does not appear to have an effect. It should not matter anyway. It should autocommit if a transaction isn't declared. Can someone help, please?



                • 5. Re: Data Updations are not happening
                  ganesh Newbie

                  Thanks for the Tip,it's making sense now


                  • 6. Re: Data Updations are not happening
                    speedy_omen Newbie

                    you'll need a XADataSourceLoader in your jboss.jcml ... Then transactions will be committed