Bug #43327 | Transaction/Rollback | ||
---|---|---|---|
Submitted: | 3 Mar 2009 11:40 | Modified: | 9 Mar 2009 9:15 |
Reporter: | R Roberts | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 5.2.1 | OS: | Windows |
Assigned to: | CPU Architecture: | Any |
[3 Mar 2009 11:40]
R Roberts
[3 Mar 2009 11:41]
R Roberts
I have tried this approach and yet again it still did not rollback either; just kept inserting it: int RowsAffected = 0; manufacturersTableAdapter X = new manufacturersTableAdapter(); X.Connection.Open(); MySqlTransaction myTrans = X.Connection.BeginTransaction(); X.AttachTransaction(myTrans); try { DataSet1.manufacturersDataTable manuRows = X.GetAllManufacturers(); DataView view = new DataView(manuRows); view.RowFilter = "manufacturer_id = '" + Code + "'"; if (view.Count == 0) { X.Insert(Code, Description); throw new Exception(); } else { texstatus = "The code you have entered is already in use. Please use another."; } } catch (Exception ex) { myTrans.Rollback(); texstatus = "Transaction has been aborted!"; }
[3 Mar 2009 11:41]
R Roberts
Any luck with it? Is there a way to resolve this please?
[3 Mar 2009 11:50]
Tonci Grgin
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug. Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/ Thank you for your interest in MySQL. Explanation: Hi Romy and thanks for your report. I should not do neither code-review nor manual reading for reporters... Anyways, you are probably using transactional storage engine and have auto_commit set to true. Please see documentation regarding this.
[9 Mar 2009 9:15]
R Roberts
Hi I realised that I cannot ask questions or advice regarding this. But I have spent over 4 months trying to get the transactions to work in C#. I have checked the MySql database which uses INNODB and also I have turned off the AUTOCOMMIT. But I still cannot get the transactions to work directly in C# (VS2005). I have really tried hard to post all the problems with transactions on the forum and yet I have had little feedback. I cannot get my project moving forward because of the transaction 'stalemate' problem. Can you please please help out on what I am missing or is there something wrong with my C# coding? Sincerely appreciate the time and effort you are putting into this. Thanks Romy