Serializable
allows one transaction to complete before the other start.
SqlConnectoin
support named savpoint to roll back to; that’s an equaliant to save transaction
command in MS SQL Server.
Using
TransactionScope Object:
A transaction can’t span multiple connections.
Local
and distributed transaction ares supported in 1.x you have to Enterpeise
seveices library to regiser multiple connections and then call
EnlistDistributedTransaction. Distributed Transaction Coordinator is required
for Distributed transaction that’s available on windows 2000 & +.
Serializable
allows one transaction to complete before the other start.
SqlConnectoin
support named savpoint to roll back to; that’s an equaliant to save transaction
command in MS SQL Server.
Using
TransactionScope Object:
Dispoase
of the transaction must be called to complete the transaction.
Distributed
Transaction:
All
object can be enlisted within transaction which implement ITransaction interface.
Storing
and retrieving CLR types:
Using SqlNotificationRequest:
Enable
Notification System on Sql Server 2005.
ALTER
DATABASE AdventureWorks SET ENABLE_BROKER;
Setup Database:
CREATE QUEUE ContactChangeMessages;
CREATE SERVICE ContactChangeNotifications
ON QUEUE
ContactChangeMessages
([http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification]);
private void Listen()
{
using (SqlCommand
command =
new
SqlCommand("WAITFOR (RECEIVE * FROM ContactChangeMessages);",
connection))
{
// Make sure we don't
time out before the
// notification request
times out.
if (connection.State != ConnectionState.Open)
{
connection.Open();
}
command.CommandTimeout = NotificationTimeout + 120;
AsyncCallback
callBack = new AsyncCallback(
this.OnReaderComplete);
IAsyncResult
asynResult = command.BeginExecuteReader(
callBack,
command);
if
(asynResult.IsCompleted == true)
{
waitInProgress =
true;
}
}
}
private void OnReaderComplete(IAsyncResult asynResult)
{
SqlDataReader reader =
((SqlCommand)asynResult.AsyncState)
.EndExecuteReader(asynResult);
while
(reader.Read())
// Empty queue
of messages.
// Application
logic could partse
// the queue
data to determine why things.
{
for (int i =
0; i <= reader.FieldCount - 1; i++)
Debug.WriteLine(reader[i].ToString());
}
reader.Close();
}