Results 1 to 6 of 6

Thread: HELP - It is killing me!!!! HELP (MTS/COM+)

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    44

    Exclamation

    (* Sorry about my english , I am from Israel *)

    I admit it , I cant handle it anymotre , If you wont help i will die.

    Please take a loot on this code:

    Public Function DeleteCustomer(strCustomerID As String) As Boolean

    some code against DB

    end function


    WOOHOO! its works fine (100% fine - even after i compile the client to exe and the Middle Tier to dll.

    but This code isnt working for me!:


    Public Function DeleteCustomer(strCustomerID As String) As Boolean

    on error goto ErrHandler
    Dim objContext As ObjectContext
    Set objContext = GetObjectContext

    some code against DB

    objContext.SetComplete

    exit function
    ErrHandler:

    objContext.SetAbort

    end function


    Thats it. just added some simple MTS code , i changed the MTStransactionMode
    property to 2 (requeird trans) and i made a ref for the COM+ (i am working with win2k but its the same at NT 4 (right?)


    After i recomplie both exe and dll and run it again , the SAME code not working for me!!
    i got error msg: object variable do not set , but this is not the reason...

    PLEASE any idea whats the porblem will help a lot,
    I wait for your reply!!

    Thanks!
    Namo.


  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696

    Question

    Sorry If this is a stupid question, but have you included the reference for the project. If not go to Project,References then Find Microsoft Transaction Server type libary.

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    shalom Namo

    Your code looks good, did you register the DLL after you compiled it with the COM+ Manager?

    The problem is that you're not retrieving the object context, possibly because the component is not properly configured for COM+

    Tom

  4. #4

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    44
    Ianpbaker - Yes , I made a ref . not to Microsoft Transaction Server type libary. Bcoz i use win2k , and its called now COM+ Service (this is not the problem for sure)

    Clunietp - yes , i registerd it (new applicainon and added the component etc..)

    I think i found that problem . i noticed (after 100000 hours) that the object.SetComple working. BUT after object.SetComple or object.SetAbort my Calss Terminate and Initailize ( 2 events . destryo and build) events are fired ,this is the resaon for the problem.

    I have 2 questions for you

    1. You know why this 2 events fired? can i change it somehow? (is it only with COM+ maybe?)

    2. You knoy how i can debug my component without compile it first? everytime i want to check something with MTS i have to compile it first and run the exe file that call the dll, can u make MTS enable when i debug? (i got win2k pro.)

    Toda Clunietp !!!

    Namo.


  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    44

    Thanks for the reply

    Clunietp , About 1 : yeah , you right and i will use the IObjectControl_Activate and IObjectControl_Deactivate methods from now, BUT my class will still recreate - i will still loose connecting and reconnect , right?
    i mean . if i declare objConnection in my General Declaration , after .SetComplte/.SetAbort this connection object will go down (like all the class , even i dont put any code on Class_Initialize and Class_Terminate events, Bcoz it will recreated , right?)
    hmm , so whtas it the diff between IObjectControl_Activate / IObjectControl_Deactivate to Class_Initialize and Class_Terminate

    (Sorry ,i am kinda new with this )

    about 2. VB IDE=? is it the regular vb app. ? or what is it? Bcoz i already tryed to use it in the regualr vb app.

    I hope you understand my english , Thanks alot!

    Namo.

  6. #6
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Namo:

    1. Do not have a private connection object declared at module level. COM+ does connection pooling for you, so you don't want to implement any startup/shutdown code to connect/disconnect from your DB. I guess you could without any problems, but then your functions are less cohesive.


    2. the VB IDE is the editor, where you type in your code. You can get the object context when you debug it (F5)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width