I have 3 classes:
Class 1(Not an MTS Object)
Class 2(Requires Transaction)
Class 3(Supports Transaction)
All the three are part of one dll which is registered under MTS.
I have to test a simple roll back functionality, In which My class 3 is updating a database table and the class 2 should rollback the transaction. To do this I am creating the object of Class 2 in class 1 using the New operator and the object of Class 3 in class 2 using the CreateInstance method of ObjectContext object. I am calling the method of class 1 through some dummy method, which internally calls method of class 2 and that inetrnally calls method of class 3 to update the database. When I observe the MTS console I found that the object of class 1 and class 3 are getting creted but the object of class 2 is not getting created under MTS, which means the transaction is not getting rollbacked. When I created the object of class 2 using CreateObject everything worked perfectly fine.
Please tell me how New and CreateObject behave differently in MTS world and when to use which?
Class 1(Not an MTS Object)
Class 2(Requires Transaction)
Class 3(Supports Transaction)
All the three are part of one dll which is registered under MTS.
I have to test a simple roll back functionality, In which My class 3 is updating a database table and the class 2 should rollback the transaction. To do this I am creating the object of Class 2 in class 1 using the New operator and the object of Class 3 in class 2 using the CreateInstance method of ObjectContext object. I am calling the method of class 1 through some dummy method, which internally calls method of class 2 and that inetrnally calls method of class 3 to update the database. When I observe the MTS console I found that the object of class 1 and class 3 are getting creted but the object of class 2 is not getting created under MTS, which means the transaction is not getting rollbacked. When I created the object of class 2 using CreateObject everything worked perfectly fine.
Please tell me how New and CreateObject behave differently in MTS world and when to use which?