Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > Transactions in version 3 series of mysql
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
1 14th November 04:42
pep
External User
 
Posts: 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.
  Reply With Quote


 


2 14th November 04:42
martijn tonies
External User
 
Posts: 1
Default Transactions in version 3 series of mysql



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
  Reply With Quote
3 14th November 04:42
axel schwenke
External User
 
Posts: 1
Default Transactions in version 3 series of mysql


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/
  Reply With Quote
4 14th November 04:42
pep
External User
 
Posts: 1
Default Transactions in version 3 series of mysql


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.
  Reply With Quote
5 14th November 04:42
axel schwenke
External User
 
Posts: 1
Default Transactions in version 3 series of mysql


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/
  Reply With Quote
6 14th November 04:45
pep
External User
 
Posts: 1
Default Transactions in version 3 series of mysql


Thanks,
Pep.
  Reply With Quote
Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Development, Ada, Apple script, Assembler, Awk, Beos, Basic, C, C++, C#, C# .net, .net, .net frameworks, Asp .net, Clarion, Clipper, Clos, Clu, Cobol, Coldfusion, Delphi, Dylan, Eiffel, Forth, Fortran, Haskell, Hermes, Icon, Idl, Java, Java script, Jscript .net, Jcl, Linoleum, Lisp, Lotus, Limbo, Logo, Ml, Mumps, Oberon, Postscript, Pop, Pl1, Prolog, Python, Ruby, Pascal, Perl, Php, Rebol, Rexx, Sed, Sather, Scheme, Smalltalk, Tcl, Vhdl, Vrml, Visual basic, Visual basic .net, Yorick, Mysql, Omnis, Postgresql, Xbase, Access, Oracle, Adabas, Berkeley, Btrieve, Filemaker, Gupta, Db2, Informix, Ingres, Mssql server, Object, Olap, Paradox, Rdb, Revelation, Sybase, Theory, Dbase, Html, Java script, Css, Flash, Photoshop, Corel script, Xml, Tech, Beos, Gem, Hp48, Hpux, Linux, Mac, Ms-dos, Os2, Palm, Solaris, Ti99, Windows, Xenix, Aos, Chorus, Geos, Inferno, Lantastic, Lynx, Mach, Minix, Netware, Os9, Parix, Plan9, Psos, Qnx, Xinu, Sco, Unix, Aix, Aux, 386bsd, Bsdi, Freebsd, Netbsd, Openbsd, Ultrix, Amd, Intel, Aptiva, Buz, Deals, Homebuilt, Overclocking, Programming, Extra forums


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666