9 Replies Latest reply on May 21, 2006 3:58 AM by Sajid Moinuddin

    Transactions not timeouting

    Ales Justin Master

      I'm having a problem with transactions not timeouting - failing to suspend a probable lock.

      I'm using a MySQL 5.0.15 with InnoDB engine, MySql Connector / J 5.0.0.
      With 'SHOW FULL PROCESSLIST' command I can see that there are also two connections stuck on my db:

      Prekini proces 42205 portal localhost:38444 jbossportal Sleep 45022 [BLOB - NULL]
      Prekini proces 42206 portal localhost:50910 jbossportal Sleep 45022 [BLOB - NULL]

      This is my -ds.xml file:

       <local-tx-datasource>
       <jndi-name>PortalDS</jndi-name>
      
       <connection-url>jdbc:mysql://petrosjan:3326/jbossportal</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
       <user-name>portal</user-name>
       <password>portovc</password>
      
       <min-pool-size>5</min-pool-size>
       <max-pool-size>20</max-pool-size>
      
       <idle-timeout-minutes>5</idle-timeout-minutes>
      
       <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
       <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
      
       <metadata>
       <type-mapping>mySQL</type-mapping>
       </metadata>
       </local-tx-datasource>
      


      So when I check my TransactionManager MBean through jmx-console I always get at least two transactions still active:

      TransactionCount long R 2 Counts the number of active transactions

      I didn't change any TM settings.

      What can be the reason for not suspending these transactions?

      Rgds, Ales

      btw: does any one know how to see what those two processes on mysql actually are - which statments are they executing - to see what the probable lock is?

        • 1. Re: Transactions not timeouting
          Sajid Moinuddin Newbie

          I am facing the same problem....however, show processlist will show the mysql processes.
          let me know if u find any solution

          • 2. Re: Transactions not timeouting
            Ales Justin Master

            Hmm .. in fact timeout was called

            2006-05-16 21:57:52,447 WARN [org.jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=energetika/19044, BranchQual=, localId=19044] timed out. status=STATUS_ACTIVE
            2006-05-16 21:57:53,075 WARN [org.jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=energetika/19045, BranchQual=, localId=19045] timed out. status=STATUS_ACTIVE
            


            Exactly 300s after start.

            By why wasn't it suspended?
            Since TM's interruptThreads is by default false - (which) threads weren't interrupted?
            Why isn't it good to have interruptThreads set to true?

            Why doesn't database release / suspend connections - and that way its coresponding transaction?

            Rgds, Ales

            • 3. Re: Transactions not timeouting
              Sajid Moinuddin Newbie

              Hi,
              "But why wasn't it suspended?" do we really want it to be suspended when it times out? Suspend means something else in transactional world. Instead we want it to be rolled back/ discarded. Which it isn't doing. I am facing the same problem here. My transaction remains active forever. Pls let me know if you find any solution.
              regards,
              Sajid

              • 4. Re: Transactions not timeouting
                Ales Justin Master

                 


                Suspend means something else in transactional world. Instead we want it to be rolled back/ discarded.


                I know what suspend means :-).

                What you are saying isn't exactly true.
                In case you already have a transaction, at the beging you want to resume on it and at the end suspend it.
                But if you don't have a transaction before, you want your new / current transaction to end in a rollback/commit.

                Any way - our common stuff is that we want that transaction to finish - rollback/commit or suspend.

                Rgds, Ales

                • 5. Re: Transactions not timeouting
                  Sajid Moinuddin Newbie

                  hmmm.....i guess you are right....Anyway...i just configured the JBossTx (replaced the default tx manager) shipped with jboss. I have done few tests and my test cases which were failing before are passing now....Seems it works. But i'll have to do some further verification. You can give it a try.
                  regards,
                  Sajid

                  • 6. Re: Transactions not timeouting
                    Ales Justin Master

                    Does the new JBossTx already support JBossAS 4.0.4CR2?
                    Since I think I saw in some forum thread that it doesn't ... yet.

                    How hard it is to replace the tx manager?

                    Rgds, Ales

                    • 7. Re: Transactions not timeouting
                      Mark Little Master

                       

                      "alesj" wrote:
                      Does the new JBossTx already support JBossAS 4.0.4CR2?
                      Since I think I saw in some forum thread that it doesn't ... yet.

                      How hard it is to replace the tx manager?

                      Rgds, Ales


                      Not yet. It's on the roadmap, so it will happen soon. There are changes that we had to make to the AS source in 4.0.3SP1 that we'll need to feed back into 4.0.4 for the nex release to make the integration seamless.

                      Kev did that work and once he wakes up he may post something here. However, I wouldn't recommend doing this yourself unless you're really keen.

                      • 8. Re: Transactions not timeouting
                        Kevin Conner Master

                        I believe all the issues in the 4.0.3 codebase have been fixed in the 4.0.4 codebase but there may be other issues we have yet to encounter with 4.0.4. We can't tell until we go through the QA process.

                        I am hoping to start this process soon as 4.0.4 is now out.

                        Kev

                        • 9. Re: Transactions not timeouting
                          Sajid Moinuddin Newbie

                          The replacement of Tx manager is not hard. It took me around 2 hours. The documentation is quite good. However, The ClientUserTransaction depend on the default user transaction setting. Since i'm not using that, I didn't bother to fix that.

                          Let me know if you already found any better solution.
                          best of luck,
                          Sajid.