6 Replies Latest reply on Feb 7, 2002 7:46 PM by miguel2

    mysql jboss3

    miguel2

      Hi,

      I'd like to use mysql (no innodb version) as non-transactional data source with cmp2. How can I stop JBoss using rollback and commit commands that result in i.e. this ugly error message:


      2002-02-06 17:06:03,385 ERROR [Default] Debug: TesterBean ejbCreate
      2002-02-06 17:06:03,397 INFO [Default] SQLException: SQLState(S1000) vendor code(1196)
      2002-02-06 17:06:03,398 INFO [Default] java.sql.SQLException: General error: Warning: Some non-transactional changed tables couldn't be rolled back
      2002-02-06 17:06:03,399 INFO [Default] at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
      2002-02-06 17:06:03,400 INFO [Default] at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
      2002-02-06 17:06:03,402 INFO [Default] at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)
      2002-02-06 17:06:03,403 INFO [Default] at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)
      2002-02-06 17:06:03,404 INFO [Default] at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)
      2002-02-06 17:06:03,405 INFO [Default] at org.gjt.mm.mysql.Connection.rollback(Connection.java:551)
      ...


      Mige

        • 1. Re: mysql jboss3
          davidjencks

          use the NoTransaction ConnectionManager. (see ch 3 of online manual)

          • 2. Re: mysql jboss3
            miguel2

            I tried it with NoTransDS from Hypersonic default service.

            This is the result:

            01:09:37,439 INFO [Default] 1:SELECT COUNT(*) FROM Tester WHERE testerID='aetrz
            etr'
            01:09:37,443 INFO [Default] 1:ROLLBACK
            01:09:37,446 INFO [Default] 1:INSERT INTO Tester (testerID) VALUES ('aetrzetr')
            01:09:37,449 INFO [Default] 1:ROLLBACK
            01:09:37,476 ERROR [Default] Debug: Session newRecord after create
            01:09:37,477 ERROR [Default] $Proxy23


            Why is ROLLBACK called after each statement using a non transactional datasource ?


            Mige

            • 3. Re: mysql jboss3
              davidjencks

              Looks like I have plenty of work ahead of me....

              The local tx wrapper somewhat inappropriately calls rollback on every connection before it can go back in the pool. This does not create incorrect behavior if various other things happen (I didn't check whether they do) but is apt to be slower than necessary.

              Do you know why you are getting an error?

              • 4. Re: mysql jboss3
                miguel2

                my interpretation of this error message


                2002-02-06 17:06:03,385 ERROR [Default] Debug: TesterBean ejbCreate
                2002-02-06 17:06:03,397 INFO [Default] SQLException: SQLState(S1000) vendor code(1196)
                2002-02-06 17:06:03,398 INFO [Default] java.sql.SQLException: General error: Warning: Some non-transactional changed tables couldn't be rolled back
                2002-02-06 17:06:03,399 INFO [Default] at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
                2002-02-06 17:06:03,400 INFO [Default] at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
                2002-02-06 17:06:03,402 INFO [Default] at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)
                2002-02-06 17:06:03,403 INFO [Default] at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)
                2002-02-06 17:06:03,404 INFO [Default] at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)
                2002-02-06 17:06:03,405 INFO [Default] at org.gjt.mm.mysql.Connection.rollback(Connection.java:551)


                As mysql itself ignores the rollback command (i.e executed in standard client) the jdbc driver generates this warning (I use mm.mysql 2.0.11).

                There seem to be two solutions for this problem:

                a) make jboss not to call rollback on notrans datasources
                or
                b) make mm.mysql not to throw a warn message when rollback is called

                I would prefer a) because this is what correctly causes b).


                Mige

                • 5. Re: mysql jboss3
                  davidjencks

                  I agree, (a) is correct. Now to find some time...

                  There is quite a bit of non-spec compliant behavior around "no transaction" stuff in the jdbc wrappers...

                  • 6. Re: mysql jboss3
                    miguel2


                    Thanks for wasting your time,

                    Mige