logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
COMMIT

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Sun Jan 14, 2007 14:40    Post subject: COMMIT Reply with quote

In nwnx4 MySQL connection, is it necessary to use SQLExecDirect("BEGIN TRANSACTION;") AND SQLExecDirect("COMMIT;"); in scripts ?

In which case ?

Mostal
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Jan 14, 2007 23:18    Post subject: Reply with quote

The generic answer to this question would be: NWNX4 does not do anything special to your database connection. Transaction handling is like it would be without NWNX.

The longer answer from http://dev.mysql.com/doc/refman/5.0/en/commit.html:

Quote:
By default, MySQL runs with autocommit mode enabled. This means that as soon as you execute a statement that updates (modifies) a table, MySQL stores the update on disk.

If you are using a transaction-safe storage engine (such as InnoDB, BDB, or NDB Cluster), you can disable autocommit mode with the following statement:

SET AUTOCOMMIT=0;


So the answer would be: It's not necessary to commit, unless you are handling transaction on your own by disabling autocommit mode like in the example above.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Mon Jan 15, 2007 11:55    Post subject: Reply with quote

thanks Papillon
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group