#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 2 of 5)
  • Bengt Gunne
    Bengt Gunne
    2005-04-20

    • assigned_to: nobody --> mimerbg
     
  • Bengt Gunne
    Bengt Gunne
    2005-04-20

    Logged In: YES
    user_id=895705

    You sent a duplicate of your previous message...

    I need to be able to reproduce your problem to be able to
    help you. Since I am only seeing parts of your code and that
    part looks ok I thought it would be a good idea if you could
    help me repeat the problem!

    Please take a look at F15_DataAdapterTransaction and get
    back to me!

     
  • Sean Flook
    Sean Flook
    2005-04-20

    Logged In: YES
    user_id=684148

    Sorry about the duplicate message, but I was trying to get
    the file, but I can not see it in CVS yet.

     
  • Sean Flook
    Sean Flook
    2005-04-20

    Source File

     
    Attachments
  • Sean Flook
    Sean Flook
    2005-04-20

    Logged In: YES
    user_id=684148

    As I still can not see your file I have attached my source file.
    The method that is being called is Create (line 2826)

     
  • Bengt Gunne
    Bengt Gunne
    2005-04-20

    Logged In: YES
    user_id=895705

    Every time you call BeginTransaction you get a new instance
    of the MpmTransaction class. So the assignement you do in
    the constructor:

    cmdSelect.Transaction = trans; //SF IT2838

    is not the transaction instance that is active when you call
    Update. In SaveType21 add the line:

    daASD.SelectCommand.Transaction = trans;

    and check if that does not help.

     
  • Sean Flook
    Sean Flook
    2005-04-20

    Logged In: YES
    user_id=684148

    Sorry, I gave you the wrong method that I am testing. I am
    using the Create method (line 2847) and the first call is to
    the Street.Create. I have added

    daStreet.SelectCommand.Transaction = trans;

    to this method, but I still get the exception.

     
  • Bengt Gunne
    Bengt Gunne
    2005-04-21

    Logged In: YES
    user_id=895705

    I cannot see this in your source...

    You have several commands attached to your data adapter
    and you should assign the transaction property on all of them.

     
  • Sean Flook
    Sean Flook
    2005-04-21

    Logged In: YES
    user_id=684148

    Sorry I should have given you the line number (Street.Create
    starts on line 1282)

    I have tried setting the transaction property for all the
    commands as shown below:

    daStreet.InsertCommand.Connection = conn;
    daStreet.InsertCommand.Transaction = trans;
    daStreet.SelectCommand.Transaction = trans;
    daStreet.UpdateCommand.Transaction = trans;
    daStreet.DeleteCommand.Transaction = trans;

    But I am still getting the error.

     
  • Bengt Gunne
    Bengt Gunne
    2005-04-21

    Logged In: YES
    user_id=895705

    Can you look at my test code now?

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