F
Francois Malgreve
Hi dear,
I need to implement Distributed Transactions in my application as it is
using 2 SQL servers.
I am using windows server 2003, Sql Server 2000 and .Net 1.1.
After a first post and some research on google I have seen that there is a
package System.EnterpriseServices part of the .Net framework that interface
with COM+ components. It seems to interface with the DTC windows service. My
problem is that I have no experience with that package neither with COM+
component.
What I really need is a tutorial of how to implement Distributed Transaction
in a software, for exemple, should it be at the Business Layer level (I
think so) or can the Data layer take care of that by itself? And also how to
achieve it? What is the best design / best practice? For exemple sometimes
some business methods can be the root of a transaction but sometimes they
can be part of a greater user case, thus be part of an existing transaction.
I have seen some source code with stuff like the following but i simply do
not understand it (the attributes in front of the class and methods
declaration.). Also note that the class MUST inherit ServicedComponent...
Also i do not know if it is flexible enough and resolving an important
issue which is some methods may have to initiate their transactions
themselves as they are the root of the transaction or using an existing
transaction, depending of the use case.
[Transaction(System.EnterpriseServices.TransactionOption.Required)]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ObjectPooling(MinPoolSize=4, MaxPoolSize=4)]
// WHAT IS THIS ??
[Guid("14E3573D-78C8-4220-9649-BA490DB7B78D")]
public class OrderInsert : ServicedComponent {
....
[AutoComplete]
public int Insert(OrderInfo order) {
....
}
}
I am a beginner in Distributed Transaction but I know what is a transaction
and i have been using it many times on single DB connection.
I have also seen that the SqlConnection class has a method
EnlistDistributedTransaction() but in the sample code I have seen using
distributed transaction, it is not using that method but seems to rely
entirely on the System.EnterpriseServices and on the "magic" attributes
defined in front of the class definition.
Is there someone who has a good idea of where i can find some help /
resource / book to help me gain knowledge about Distributed Transaction in
general and how to implement it? All I can see from the web are exemples but
I would ideally need more than that I need an explanation of how it is
implemented and why it is implemented that way and also what options and
attributes I can use. Also why objects seems to be pooled... see attribute
[ObjectPooling(MinPoolSize=4, MaxPoolSize=4)] Is there anywhere a reference
about those attributes?
Best regards and thanks a lot in advance.
Francois Malgreve
I need to implement Distributed Transactions in my application as it is
using 2 SQL servers.
I am using windows server 2003, Sql Server 2000 and .Net 1.1.
After a first post and some research on google I have seen that there is a
package System.EnterpriseServices part of the .Net framework that interface
with COM+ components. It seems to interface with the DTC windows service. My
problem is that I have no experience with that package neither with COM+
component.
What I really need is a tutorial of how to implement Distributed Transaction
in a software, for exemple, should it be at the Business Layer level (I
think so) or can the Data layer take care of that by itself? And also how to
achieve it? What is the best design / best practice? For exemple sometimes
some business methods can be the root of a transaction but sometimes they
can be part of a greater user case, thus be part of an existing transaction.
I have seen some source code with stuff like the following but i simply do
not understand it (the attributes in front of the class and methods
declaration.). Also note that the class MUST inherit ServicedComponent...
Also i do not know if it is flexible enough and resolving an important
issue which is some methods may have to initiate their transactions
themselves as they are the root of the transaction or using an existing
transaction, depending of the use case.
[Transaction(System.EnterpriseServices.TransactionOption.Required)]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ObjectPooling(MinPoolSize=4, MaxPoolSize=4)]
// WHAT IS THIS ??
[Guid("14E3573D-78C8-4220-9649-BA490DB7B78D")]
public class OrderInsert : ServicedComponent {
....
[AutoComplete]
public int Insert(OrderInfo order) {
....
}
}
I am a beginner in Distributed Transaction but I know what is a transaction
and i have been using it many times on single DB connection.
I have also seen that the SqlConnection class has a method
EnlistDistributedTransaction() but in the sample code I have seen using
distributed transaction, it is not using that method but seems to rely
entirely on the System.EnterpriseServices and on the "magic" attributes
defined in front of the class definition.
Is there someone who has a good idea of where i can find some help /
resource / book to help me gain knowledge about Distributed Transaction in
general and how to implement it? All I can see from the web are exemples but
I would ideally need more than that I need an explanation of how it is
implemented and why it is implemented that way and also what options and
attributes I can use. Also why objects seems to be pooled... see attribute
[ObjectPooling(MinPoolSize=4, MaxPoolSize=4)] Is there anywhere a reference
about those attributes?
Best regards and thanks a lot in advance.
Francois Malgreve