// (C)2005 Novell Inc,
// (C)2006 Novell Inc,
//
-#if NET_2_0
+#if NET_2_0\r
+using System.Configuration;\r
+using System.Transactions.Configuration;
namespace System.Transactions
{
public static class TransactionManager
{
- /* 60 secs */
- static TimeSpan defaultTimeout = new TimeSpan (0, 1, 0);
- /* 10 mins */
- static TimeSpan maxTimeout = new TimeSpan (0, 10, 0);
+ static TransactionManager ()
+ {\r
+ defaultSettings = ConfigurationManager.GetSection ("system.transactions/defaultSettings") as DefaultSettingsSection;\r
+ machineSettings = ConfigurationManager.GetSection ("system.transactions/machineSettings") as MachineSettingsSection;
+ }\r
+\r
+ static DefaultSettingsSection defaultSettings;\r
+ static MachineSettingsSection machineSettings;\r
+ static TimeSpan defaultTimeout = new TimeSpan (0, 1, 0); /* 60 secs */\r
+ static TimeSpan maxTimeout = new TimeSpan (0, 10, 0); /* 10 mins */
- public static TimeSpan DefaultTimeout {
- get { return defaultTimeout; }
+ public static TimeSpan DefaultTimeout {\r
+ get {\r
+ // Obtain timeout from configuration setting..\r
+ // - http://msdn.microsoft.com/en-us/library/ms973865.aspx\r
+ // - http://sankarsan.wordpress.com/2009/02/01/transaction-timeout-in-systemtransactions/\r
+ // 1. sys.txs/defaultSettings[@timeout]\r
+ // 2. defaultTimeout\r
+\r
+ if (defaultSettings != null)\r
+ return defaultSettings.Timeout;
+
+ return defaultTimeout;
+ }
}
- [MonoTODO]
+ [MonoTODO ("Not implemented")]
public static HostCurrentTransactionCallback HostCurrentCallback {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public static TimeSpan MaximumTimeout {
- get { return maxTimeout; }
+ get {\r
+\r
+ if (machineSettings != null)\r
+ return machineSettings.MaxTimeout;
+
+ return maxTimeout;
+ }
}
- [MonoTODO]
+ [MonoTODO ("Not implemented")]
public static void RecoveryComplete (Guid manager)
{
throw new NotImplementedException ();
}
- [MonoTODO]
+ [MonoTODO ("Not implemented")]
public static Enlistment Reenlist (Guid manager,
byte[] recoveryInfo,
IEnlistmentNotification notification)