MYsql & transactions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • princevejita1@wp.pl

    #1

    MYsql & transactions

    Hello

    I have problem with my MySQL server and transactions. I installed MySQL
    server 5.0.11 with MySQL administrator & MySql Query Browser on Win XP
    Prof. I would like to use transactions, so I have read the manual ana I
    thought I knew how to do it. I set the tables type to InnoDB (i can't
    use BDB) and change the default mysqld.exe to mysql-max (or
    mysql-max-nt). I even used : SET AUTOCOMMIT=0.
    I'm doing more less this:
    1. START TRANACTION (i've tried also BEGIN /WORK/ )
    2. UPDATE some table for example :
    UPDATE account SET balance=balance-100 WHERE id=2

    ---- 1 row affected by the last command, no resulset returned
    //Shouldn't it waite until COMMIT ??
    3. ROLLBACK
    ---- Query returned no resultset

    I looks like Mysql doesn't support transactions.

    Does anyone have any suggestions about possible cause of tis problem?
    Maybe some link? Any advise would be apreciated. I don't know what to
    do.

    Please help me :/
    Tom

  • Gordon Burditt

    #2
    Re: MYsql & transactions

    >I have problem with my MySQL server and transactions. I installed MySQL[color=blue]
    >server 5.0.11 with MySQL administrator & MySql Query Browser on Win XP
    >Prof. I would like to use transactions, so I have read the manual ana I
    >thought I knew how to do it. I set the tables type to InnoDB (i can't
    >use BDB) and change the default mysqld.exe to mysql-max (or
    >mysql-max-nt). I even used : SET AUTOCOMMIT=0.
    >I'm doing more less this:
    >1. START TRANACTION (i've tried also BEGIN /WORK/ )
    >2. UPDATE some table for example :
    > UPDATE account SET balance=balance-100 WHERE id=2
    >
    >---- 1 row affected by the last command, no resulset returned[/color]
    An update never returns a resultset.[color=blue]
    > //Shouldn't it waite until COMMIT ??[/color]

    The query can still tell you how many rows were affected. It doesn't
    mean the change is committed yet. You wouldn't want to find out
    you'd made a typo, leaving off the WHERE clause, and affected 100,000
    records *AFTER* you typed "COMMIT", would you? Or perhaps you
    should check what you just did if it comes back "0 rows affected".
    [color=blue]
    >3. ROLLBACK
    >---- Query returned no resultset[/color]

    A rollback never returns a resultset.
    [color=blue]
    >I looks like Mysql doesn't support transactions.[/color]

    How do you conclude that? Did the balance change from step 2 take
    after the rollback? If so, it doesn't look like there is transaction
    support. If not, it looks like there IS.
    [color=blue]
    >Does anyone have any suggestions about possible cause of tis problem?[/color]

    What problem?

    Gordon L. Burditt

    Comment

    • princevejita1@wp.pl

      #3
      Re: MYsql & transactions

      Ok
      You right and I didn't explain enough my situation.
      I didn't write, but after the rollback the balance remained changed,
      while according to manual it should changed back.
      In other words I can't cancel changes made to a table and I wish I knew
      how to do it.

      Comment

      • Gordon Burditt

        #4
        Re: MYsql & transactions

        >You right and I didn't explain enough my situation.[color=blue]
        >I didn't write, but after the rollback the balance remained changed,
        >while according to manual it should changed back.
        >In other words I can't cancel changes made to a table and I wish I knew
        >how to do it.[/color]

        Are you sure your tables are InnoDB, not MyISAM? SHOW CREATE TABLE
        or SHOW TABLE STATUS to find out.

        Gordon L. Burditt

        Comment

        • princevejita1@wp.pl

          #5
          Re: MYsql & transactions

          Yes definitely. Engine: InnoDB :(.

          Comment

          • princevejita1@wp.pl

            #6
            Re: MYsql & transactions

            Ok I think I works now a bit better. I will test my server more and
            I'll write how it works.

            Thank's for you help and time.

            Comment

            Working...