Bug #27754 nested transaction with 1.0.9 connector .NEt
Submitted: 11 Apr 2007 12:33 Modified: 23 May 2007 14:39
Reporter: Sebastien Bonnet Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:1.0.9 OS:Microsoft Windows (XP and vista)
Assigned to: CPU Architecture:Any
Tags: nested transactions error

[11 Apr 2007 12:33] Sebastien Bonnet
Description:
hi
i read Bug #22400 and i see this error had fixed in 1.0.9 but i have the same problem

begininng of my code:
 _datatable = New System.Data.DataTable
            myQuery = "SET AUTOCOMMIT=0;" & myQuery

            _MySQL_command = New Global.MySql.Data.MySqlClient.MySqlCommand(myQuery, _mySQL_Connection)

            _MySQL_adapter.UpdateCommand = _MySQL_command

            _MySQL_transaction = _MySQL_command.Connection.BeginTransaction()

            _MySQL_adapter.UpdateCommand.Transaction = _MySQL_transaction

i use the same connection for all transactions
here, i use an update function for second time

i m going to try with NotSupportedException(); to see...

How to repeat:
Public Sub MySQL_update(ByVal myQuery As String, ByVal WaitingReturn As Boolean, ByVal ParamArray myParameters() As String)

            _datatable = New System.Data.DataTable
            myQuery = "SET AUTOCOMMIT=0;" & myQuery

            _MySQL_command = New Global.MySql.Data.MySqlClient.MySqlCommand(myQuery, _mySQL_Connection)

            _MySQL_adapter.UpdateCommand = _MySQL_command

            _MySQL_transaction = _MySQL_command.Connection.BeginTransaction()

            _MySQL_adapter.UpdateCommand.Transaction = _MySQL_transaction

            If myParameters.Length > 0 Then
                For i As Integer = 0 To myParameters.Length - 1 Step 2
                    If myParameters(i + 1).ToString = "Null" Then
                        _MySQL_adapter.UpdateCommand.Parameters.Add(myParameters(i), DBNull.Value)
                    Else
                        _MySQL_adapter.UpdateCommand.Parameters.Add(myParameters(i), myParameters(i + 1))
                    End If
                Next
            End If
            If WaitingReturn Then
                Try
                    _MySQL_adapter.Fill(_datatable)
                    _MySQL_transaction.Commit()
                Catch e As Global.MySql.Data.MySqlClient.MySqlException
                    _MySQL_transaction.Rollback()
                    Nexus.erreurs.message_erreur_mysql(e.Source, e.Number, e.Message, myQuery, myParameters)
                    _datatable = Nothing
                End Try
            Else
                Try
                    _MySQL_adapter.UpdateCommand.ExecuteNonQuery()
                    _MySQL_transaction.Commit()
                Catch e As Global.MySql.Data.MySqlClient.MySqlException
                    _MySQL_transaction.Rollback()
                    Nexus.erreurs.message_erreur_mysql(e.Source, e.Number, e.Message, myQuery, myParameters)
                End Try
                _datatable = Nothing
            End If
        End Sub
[11 Apr 2007 12:56] Sebastien Bonnet
i have bypass this bug to add open and close function before and after any transaction

for the moment

thx for everything
[15 Apr 2007 13:26] Tonci Grgin
Hi Sebastien and thanks for your report.

Can you please make a short, simple test case demonstarting the error with your comments in code? Also, please revise your problem description to include what you expect test case to return and what you actually get.
[20 Apr 2007 21:05] Sebastien Bonnet
sorry i have many work in progress

ok i read your comment and i will try to send you my code, my result expected and my error message
[23 Apr 2007 14:39] Tonci Grgin
Sebastien, waiting on feedback from you.
[23 May 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".