Questions about MTS


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Questions about MTS

  1. #1
    Bob Bennett Guest

    Questions about MTS


    I have a few questions about MTS.

    1. When calling an MTS component, can you use both New or CreateObject?
    Since the MTS component will be hosted on another machine anyway, can you
    use both New and CreateObject? Whatever one you can use, how do you call
    the component (example: Dim objEmployee as New clsEmployee, or Set objEmployee=CreateObject("clsEmployee.Salary"
    "computername")? Are both ways acceptable?

    2. After an instance of the MTS component/class is created, can a transaction
    be carried out in only one class by calling SetComplete. Do you have to call
    a second class in order to create a transaction? For example, you have the
    client, and class A. The client calls class A, and at the end of the method
    in class A, SetComplete is called? I tried to do this, and when I looked
    at the transaction monitor, nothing happened. In another example, I have
    the client and class A and B. The client calls calss A, which in turn calls
    class B. When I call SetComplete in both Classs B and A (both objects voted
    for a good transaction), than the transaction monitor worked. Is this the
    only way to create a transaction? Must you have one class call another class?

    3. Should you call SetComplete after each method, wheather or not you are
    using one method in one class or multiple methods in multiple classes? For
    example, if the client calls class A, and you call SetComplete at the end
    of the method, and you are not involved in a transaction (the transaction
    monitor does not work), is there a benefit in making the SetComplete call?
    Does it destroy the object and leave the Context Wrapper, or does this happed
    automatically when the method completes its call?

  2. #2
    Sergey Kats Guest

    Re: Questions about MTS


    "Bob Bennett" <bbennett1002@hotmail.com> wrote in message
    news:3aba2047$1@news.devx.com...
    >
    > I have a few questions about MTS.
    >
    > 1. When calling an MTS component, can you use both New or CreateObject?
    > Since the MTS component will be hosted on another machine anyway, can you
    > use both New and CreateObject? Whatever one you can use, how do you call
    > the component (example: Dim objEmployee as New clsEmployee, or Set

    objEmployee=CreateObject("clsEmployee.Salary"
    > "computername")? Are both ways acceptable?
    >

    Yes, but you can only use New if you exported client setup package from MTS.

    > 2. After an instance of the MTS component/class is created, can a

    transaction
    > be carried out in only one class by calling SetComplete. Do you have to

    call
    > a second class in order to create a transaction? For example, you have the
    > client, and class A. The client calls class A, and at the end of the

    method
    > in class A, SetComplete is called? I tried to do this, and when I looked
    > at the transaction monitor, nothing happened. In another example, I have
    > the client and class A and B. The client calls calss A, which in turn

    calls
    > class B. When I call SetComplete in both Classs B and A (both objects

    voted
    > for a good transaction), than the transaction monitor worked. Is this the
    > only way to create a transaction? Must you have one class call another

    class?
    >

    Transaction can be carried out in any class and can span as many classes as
    you want. If you want class A always participate in transaction make sure
    that its transaction mode is set to RequiresTransaction or
    RequiresNewTransaction.

    > 3. Should you call SetComplete after each method, wheather or not you are
    > using one method in one class or multiple methods in multiple classes?

    For
    > example, if the client calls class A, and you call SetComplete at the end
    > of the method, and you are not involved in a transaction (the transaction
    > monitor does not work), is there a benefit in making the SetComplete call?
    > Does it destroy the object and leave the Context Wrapper, or does this

    happed
    > automatically when the method completes its call?

    Calling SetComplete in every method is a good idea, it let MTS know that
    you're finished.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center