Jump to content

transaction chain-release


birbal

Recommended Posts

i was reading the mysql official site. but i have some doubt on it. getting problem to understand that.from mysql

Beginning with MySQL 5.0.3, the optional WORK keyword is supported for COMMIT and ROLLBACK,
what is the function of WORK? there is a option for work after COMMIT and ROLLBACK. what the WORK do?
The AND CHAIN clause causes a new transaction to begin as soon as the current one ends, and the new transaction has the same isolation level as the just-terminated transaction. The RELEASE clause causes the server to disconnect the current client session after terminating the current transaction. Including the NO keyword suppresses CHAIN or RELEASE completion, which can be useful if the completion_type system variable is set to cause chaining or release completion by default.
AND CHAIN clause causes a new transaction to begin as soon as the current one ends,which transaction starts after completing the current one?is that means it will keep trying untill it not succeded? and relase will leave it after the first try? i am not surefacing problem to get that.can anyone please elaborate it with some practical example of CHAIN and RELEASE.thank you!
Link to comment
Share on other sites

CHAIN means you have several transactions that you want to complete sequentially. RELEASE sounds pretty self-explanatory.While I don't want to discourage anyone from digging into how things work, I'm curious why you're researching transactions so much. Don't get me wrong, transactions are a fundamental part of how modern ACID databases work, but I'm curious why you're spending so much time on this. Most of this happens automatically. Is there a particular problem that you're looking to transactions as a solution for?

Link to comment
Share on other sites

As for the WORK... the MySQL documentation doesn't say anything, but T-SQL's documentation on MSDN suggests that there's no difference with or without it... I'd guess it's the same deal with MySQL.This isn't the only place where SQL has optional keywords simply to make itself sound more natural language like. Did you know that "INSERT" can be used without "INTO", and will have the same effect? "COMMIT WORK" is just another such example.

Link to comment
Share on other sites

CHAIN means you have several transactions that you want to complete sequentially. RELEASE sounds pretty self-explanatory.While I don't want to discourage anyone from digging into how things work, I'm curious why you're researching transactions so much. Don't get me wrong, transactions are a fundamental part of how modern ACID databases work, but I'm curious why you're spending so much time on this. Most of this happens automatically. Is there a particular problem that you're looking to transactions as a solution for?
no actually mysql was in my 1st semester. i missed some of classes on it and that time i did not know php (even webdesighn is not in my syllebus)that time i learnt mysql but i did not get that time how mysql work with other languages. they just taught theoreticaly. so most of the time i did not understand the purpose of practical use of some chapters. now after i started work for php its becoming more clearer. and i am trying to match up things and i am trying recall the previous chapters and trying to clear out my doubts. even my score was not good in mysql :) i am trying not to left anything behind and fullfill my gaps one by one.my base is not good enough in mysql. and this is obivious thing for my next semester.and i did not know this is some kind of optional statements and it do automatically.actually purposely i was finding transaction for my project. and that is fixed now and working fine now. i have not any problem with transaction particulary with any issue for now.just was trying to know that.
This isn't the only place where SQL has optional keywords simply to make itself sound more natural language like. Did you know that "INSERT" can be used without "INTO", and will have the same effect? "COMMIT WORK" is just another such example.
this optional syntax are always make me confused. even in books. i was thinking that rollback WORK is for doing some additional query implicitely at the time of rollback or something like that.any way thanks for the helps jsg and boen
Link to comment
Share on other sites

PHP/MySQL isn't so great to learn transactions because, as far as I know, the PHP driver for MySQL commits and rolls back things automatically. I'm not positive about that, I haven't looked into it, but I assume that's the case.
so which one is good to learn it? sql server 2005? actually sql server 2005 was in my syllebus as my computer (stone age pc :)) is not compatible with sql server 2005 i did it with mysql in home.cause it seems to me that both are same more or less. though i was not sure diffrence beetween sql server and mysql.
Link to comment
Share on other sites

It's not about MySQL... it's about PHP being potentially problematic (though I don't think the MySQLi extension has any problems with that; with their functions for that and all, I'd be surprised if there's any such issues).The benefits of transactions are most easily noticeable (and testable...) on desktop applications that interacts with databases. So... C++, C#, JAVA, etc.... anything that requires user interaction on a stand-alone GUI.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...