Professional Web Applications Themes

Transactions in version 3 series of mysql - MySQL

I'm using the C API on a major version3 database and am wondering how transaction control is implemented? In major version 4 databases you can set autocommit and do individual transaction processing using the following functions mysql_autocommit() mysql_commit() mysql_rollback() So how do you do transaction processing in a major version 3 database. I cannot find any equivalent functions as those listed above so am confused? TIA, Pep....

  1. #1

    Default Transactions in version 3 series of mysql

    I'm using the C API on a major version3 database and am wondering how
    transaction control is implemented?

    In major version 4 databases you can set autocommit and do individual
    transaction processing using the following functions

    mysql_autocommit()
    mysql_commit()
    mysql_rollback()

    So how do you do transaction processing in a major version 3 database.
    I cannot find any equivalent functions as those listed above so am
    confused?

    TIA,
    Pep.

    Pep Guest

  2. #2

    Default Re: Transactions in version 3 series of mysql

    > I'm using the C API on a major version3 database and am wondering how 

    MySQL 3 only supported transactions for the 3rd party InnoDB table type.

    InnoDB is included in v4.

    So if you're using v3, I guess you have to use a newer version of the C API
    that has these calls.


    --
    Martijn Tonies
    Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
    MS SQL Server
    Upscene Productions
    http://www.upscene.com
    My thoughts:
    http://blog.upscene.com/martijn/
    Database development questions? Check the forum!
    http://www.databasedevelopmentforum.com


    Martijn Guest

  3. #3

    Default Re: Transactions in version 3 series of mysql

    "Pep" <co.uk> wrote: 

    Those functions are pure convenience functions. You can achive the same
    using mysql_query() & friends. From $MYSQLSOURCE/libmysql/libmysql.c:

    my_bool STDCALL mysql_commit(MYSQL * mysql)
    {
    DBUG_ENTER("mysql_commit");
    DBUG_RETURN((my_bool) mysql_real_query(mysql, "commit", 6));
    }


    Got the idea?


    XL
    --
    Axel Schwenke, Senior Software Developer, MySQL AB

    Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
    MySQL User Forums: http://forums.mysql.com/
    Axel Guest

  4. #4

    Default Re: Transactions in version 3 series of mysql


    Axel Schwenke wrote: 
    >
    > Those functions are pure convenience functions. You can achive the same
    > using mysql_query() & friends. From $MYSQLSOURCE/libmysql/libmysql.c:
    >
    > my_bool STDCALL mysql_commit(MYSQL * mysql)
    > {
    > DBUG_ENTER("mysql_commit");
    > DBUG_RETURN((my_bool) mysql_real_query(mysql, "commit", 6));
    > }
    >
    >
    > Got the idea?
    >
    >
    > XL
    > --
    > Axel Schwenke, Senior Software Developer, MySQL AB
    >
    > Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
    > MySQL User Forums: http://forums.mysql.com/[/ref]

    I'll investigate your post further when I get some peace in my project
    schedule.

    For the meantime, do I suppose correct that the series 3 mysql server
    automatically commits all changes I make to the database?

    Cheers,
    Pep.

    Pep Guest

  5. #5

    Default Re: Transactions in version 3 series of mysql

    "Pep" <co.uk> wrote: 
     
    >>
    >> Those functions are pure convenience functions. You can achive the same
    >> using mysql_query() & friends. From $MYSQLSOURCE/libmysql/libmysql.c:
    >>
    >> my_bool STDCALL mysql_commit(MYSQL * mysql)
    >> {
    >> DBUG_ENTER("mysql_commit");
    >> DBUG_RETURN((my_bool) mysql_real_query(mysql, "commit", 6));
    >> }[/ref][/ref]

     

    It's not that easy. Please do yourself a favour and read this up in the
    MySQL manual. In an nutshell:

    In all currently available MySQL versions, transaction support is
    limited to InnoDB tables. Transactions are controlled with the BEGIN,
    COMMIT and ROLLBACK SQL statements and the AUTOCOMMIT server variable.

    The C API calls you mentioned above are just convenient abbreviations
    for sending COMMIT, ROLLBACK and SET AUTOCOMMIT=0|1 statements to the
    server. You get the same effect by just sending those statements to the
    server via mysql_query(). Just like the implementation above shows.


    HTH, XL
    --
    Axel Schwenke, Senior Software Developer, MySQL AB

    Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
    MySQL User Forums: http://forums.mysql.com/
    Axel Guest

  6. #6

    Default Re: Transactions in version 3 series of mysql


    Axel Schwenke wrote: 
    > [/ref]
    >

    >
    > It's not that easy. Please do yourself a favour and read this up in the
    > MySQL manual. In an nutshell:
    >
    > In all currently available MySQL versions, transaction support is
    > limited to InnoDB tables. Transactions are controlled with the BEGIN,
    > COMMIT and ROLLBACK SQL statements and the AUTOCOMMIT server variable.
    >
    > The C API calls you mentioned above are just convenient abbreviations
    > for sending COMMIT, ROLLBACK and SET AUTOCOMMIT=0|1 statements to the
    > server. You get the same effect by just sending those statements to the
    > server via mysql_query(). Just like the implementation above shows.
    >
    >
    > HTH, XL
    > --
    > Axel Schwenke, Senior Software Developer, MySQL AB
    >
    > Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
    > MySQL User Forums: http://forums.mysql.com/[/ref]

    Thanks,
    Pep.

    Pep Guest

Similar Threads

  1. [PHP] Installing PHP with MySQL RPM version
    By Mark McCulligh in forum PHP Development
    Replies: 2
    Last Post: September 9th, 07:32 PM
  2. Ruby/MySQL bug (0.1.4 version)
    By sdmitry@lrn.ru in forum Ruby
    Replies: 0
    Last Post: August 14th, 03:45 AM
  3. Patches for version 2.0.xx series kernels, and the 2.4.20
    By Gregg C Levine in forum Linux Setup, Configuration & Administration
    Replies: 1
    Last Post: July 23rd, 03:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139