#13 Error when using MpmTransaction with SQL Server database

closed
Bengt Gunne
None
5
2005-05-24
2005-04-19
Sean Flook
No

I am trying to use a MpmTransaction with a group of
update stored procedures. This code worked for SQL
Server before converting the code to use Mimer.

Now when I call the update on the dataadapter I get the
following message:

"The transaction objectis not associated with the
connection object".

The same code works fine with Oracle

Discussion

<< < 1 2 3 4 5 > >> (Page 3 of 5)
  • Sean Flook
    Sean Flook
    2005-04-21

    Modified F_Funcs.cs

     
    Attachments
  • Sean Flook
    Sean Flook
    2005-04-21

    Logged In: YES
    user_id=684148

    Yes I can now see it. I have modified it so that it follws my
    code as close as I can get it.

     
  • Bengt Gunne
    Bengt Gunne
    2005-04-21

    Logged In: YES
    user_id=895705

    After a few modifications I have run the test. Works fine! I
    have attached the file.

     
  • Bengt Gunne
    Bengt Gunne
    2005-04-21

     
    Attachments
  • Sean Flook
    Sean Flook
    2005-04-21

    Logged In: YES
    user_id=684148

    My code is still giving me the error. I have made a small
    modification to the file as I do not create thestored
    procedures on the fly and I open the connection just before
    setting the transaction and calling the create method for the
    Street object.

    Additionally, I do not know if it has an influence, but the
    stored procedure I am calling has a lot more parameters and
    2 of them are ouput parameters.

     
  • Sean Flook
    Sean Flook
    2005-04-21

     
    Attachments
  • Bengt Gunne
    Bengt Gunne
    2005-04-21

    Logged In: YES
    user_id=895705

    Still works for me.

    If you debug your application you can get hold of the
    SqlDataAdapters for the various commands:

    Use the watch window in the debugger and enter daStreet
    right before you want to perform the daStreet.Update().
    Expand daStreet and view the tree of properties:

    daStreet + _internalDataAdapter + NativeDataAdapter +
    xxxCommand

    Here you can see the properties assigned to the underlying
    plugins command objects. Maybe you can see if it looks
    consistent or not!

     
  • Sean Flook
    Sean Flook
    2005-04-21

    Logged In: YES
    user_id=684148

    I think I may have found something. If I look at
    daStreet.InsertCommand.Connection.State it is Open, but If I
    look at
    daStreet._internalDataAdapter.NativeDataAdapter.InsertCom
    mand.Connection.State it is Closed.
    daStreet._internalDataAdapter.NativeDataAdapter.InsertCom
    mand.Transaction.Connection.State is showing as Open.

     
  • Bengt Gunne
    Bengt Gunne
    2005-04-21

    Logged In: YES
    user_id=895705

    I need to understand in what order you are doing things. Of
    particular importance is the setting of DataSoure in the
    ConnectionString.

    Can you tell me the order of operations? I.e. when do you
    perform new MpmConnection, when to you set the
    connectionstring, when do set the various properties on the
    insert MpmCommand, when do you Open then connection.

    It looks like it is something with this sequence that does not
    set the internal properties correctly. But I do not see this as
    your wrapper class is not included. I would really like to set
    up this sequence in my test!

     
  • Sean Flook
    Sean Flook
    2005-04-21

     
    Attachments
<< < 1 2 3 4 5 > >> (Page 3 of 5)