incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bende...@apache.org
Subject svn commit: r820313 - in /incubator/stonehenge/trunk/stocktrader/dotnet: common/DALSQLServer/Config.cs setup_utilities/DataLoad/createdbconfig.sql
Date Wed, 30 Sep 2009 15:52:18 GMT
Author: bendewey
Date: Wed Sep 30 15:52:17 2009
New Revision: 820313

URL: http://svn.apache.org/viewvc?rev=820313&view=rev
Log:
STONEHENGE-101, updated the DB script to force SEC to be NOT NULL, also added a safety measure
in the code for older DBs

Modified:
    incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/setup_utilities/DataLoad/createdbconfig.sql

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs?rev=820313&r1=820312&r2=820313&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs Wed Sep 30
15:52:17 2009
@@ -178,7 +178,7 @@
             var response = new ClientConfigResponse();
             response.BS = rdr.GetString(rdr.GetOrdinal("URL"));
             response.BSName = rdr.GetString(rdr.GetOrdinal("BS"));
-            response.Sec = rdr.GetBoolean(rdr.GetOrdinal("SEC"));
+            response.Sec = rdr["SEC"] == DBNull.Value ? false : (bool)rdr["SEC"];
 
             rdr.Close();
 
@@ -205,7 +205,7 @@
             var response = new BSConfigResponse();
             response.OPS = rdr.GetString(rdr.GetOrdinal("URL"));
             response.OPSName = rdr.GetString(rdr.GetOrdinal("OPS"));
-            response.Sec = rdr.GetBoolean(rdr.GetOrdinal("SEC"));
+            response.Sec = rdr["SEC"] == DBNull.Value ? false : (bool)rdr["SEC"];
             response.DBName = rdr.GetString(rdr.GetOrdinal("DBNAME"));
             response.DBHostName = rdr.GetString(rdr.GetOrdinal("HOSTNAME"));
             response.DBPort = rdr.GetInt32(rdr.GetOrdinal("PORT"));
@@ -306,7 +306,7 @@
                 bsLocations[i] = new ServiceLocation();
                 bsLocations[i].ServiceName = (string)rdr["SERVICENAME"];
                 bsLocations[i].ServiceURL = (string)rdr["URL"];
-                bsLocations[i].Sec = (bool)rdr["SEC"];
+                bsLocations[i].Sec = rdr["SEC"] == DBNull.Value ? false : (bool)rdr["SEC"];
                 i++;
             }
 
@@ -326,7 +326,7 @@
                 opsLocations[i] = new ServiceLocation();
                 opsLocations[i].ServiceName = (string)rdr["SERVICENAME"];
                 opsLocations[i].ServiceURL = (string)rdr["URL"];
-                opsLocations[i].Sec = (bool)rdr["SEC"];
+                opsLocations[i].Sec = rdr["SEC"] == DBNull.Value ? false : (bool)rdr["SEC"];
                 i++;
             }
 

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/setup_utilities/DataLoad/createdbconfig.sql
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/setup_utilities/DataLoad/createdbconfig.sql?rev=820313&r1=820312&r2=820313&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/setup_utilities/DataLoad/createdbconfig.sql
(original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/setup_utilities/DataLoad/createdbconfig.sql
Wed Sep 30 15:52:17 2009
@@ -32,14 +32,14 @@
  	CREATE TABLE [dbo].[SERVICE](
 		[SERVICENAME] [varchar](50)NOT NULL,
 		[URL] [varchar](500) NOT NULL,
-		[SEC] [bit] NULL,
+		[SEC] [bit] NOT NULL,
 		CONSTRAINT [PK_SERVICE] PRIMARY KEY CLUSTERED
 		(
 			[SERVICENAME] ASC
 		)
 	) ON [PRIMARY]
 IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[SERVICE]')
AND name in (N'SEC'))
-	ALTER TABLE [dbo].[SERVICE] ADD [SEC] [bit] NULL
+	ALTER TABLE [dbo].[SERVICE] ADD [SEC] [bit] NOT NULL
 	
 IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CLIENTTOBS]')
AND type in (N'U'))
 	CREATE TABLE [dbo].[CLIENTTOBS](



Mime
View raw message