diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLLogData.cs | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs index c75290e..849d0fb 100644 --- a/OpenSim/Data/MSSQL/MSSQLLogData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs | |||
@@ -31,7 +31,7 @@ using System.Data; | |||
31 | namespace OpenSim.Data.MSSQL | 31 | namespace OpenSim.Data.MSSQL |
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
34 | /// An interface to the log database for MySQL | 34 | /// An interface to the log database for MSSQL |
35 | /// </summary> | 35 | /// </summary> |
36 | internal class MSSQLLogData : ILogData | 36 | internal class MSSQLLogData : ILogData |
37 | { | 37 | { |
@@ -46,26 +46,27 @@ namespace OpenSim.Data.MSSQL | |||
46 | public void Initialise(string connect) | 46 | public void Initialise(string connect) |
47 | { | 47 | { |
48 | // TODO: do something with the connect string | 48 | // TODO: do something with the connect string |
49 | IniFile GridDataMySqlFile = new IniFile("mssql_connection.ini"); | 49 | IniFile gridDataMSSqlFile = new IniFile("mssql_connection.ini"); |
50 | string settingDataSource = GridDataMySqlFile.ParseFileReadValue("data_source"); | 50 | string settingDataSource = gridDataMSSqlFile.ParseFileReadValue("data_source"); |
51 | string settingInitialCatalog = GridDataMySqlFile.ParseFileReadValue("initial_catalog"); | 51 | string settingInitialCatalog = gridDataMSSqlFile.ParseFileReadValue("initial_catalog"); |
52 | string settingPersistSecurityInfo = GridDataMySqlFile.ParseFileReadValue("persist_security_info"); | 52 | string settingPersistSecurityInfo = gridDataMSSqlFile.ParseFileReadValue("persist_security_info"); |
53 | string settingUserId = GridDataMySqlFile.ParseFileReadValue("user_id"); | 53 | string settingUserId = gridDataMSSqlFile.ParseFileReadValue("user_id"); |
54 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | 54 | string settingPassword = gridDataMSSqlFile.ParseFileReadValue("password"); |
55 | 55 | ||
56 | database = | 56 | database = |
57 | new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, | 57 | new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, |
58 | settingPassword); | 58 | settingPassword); |
59 | 59 | ||
60 | IDbCommand cmd = database.Query("select top 1 * from logs", new Dictionary<string, string>()); | 60 | using (IDbCommand cmd = database.Query("select top 1 * from logs", new Dictionary<string, string>())) |
61 | try | ||
62 | { | ||
63 | cmd.ExecuteNonQuery(); | ||
64 | cmd.Dispose(); | ||
65 | } | ||
66 | catch | ||
67 | { | 61 | { |
68 | database.ExecuteResourceSql("Mssql-logs.sql"); | 62 | try |
63 | { | ||
64 | cmd.ExecuteNonQuery(); | ||
65 | } | ||
66 | catch | ||
67 | { | ||
68 | database.ExecuteResourceSql("Mssql-logs.sql"); | ||
69 | } | ||
69 | } | 70 | } |
70 | 71 | ||
71 | } | 72 | } |
@@ -88,7 +89,7 @@ namespace OpenSim.Data.MSSQL | |||
88 | } | 89 | } |
89 | catch | 90 | catch |
90 | { | 91 | { |
91 | database.Reconnect(); | 92 | // it didn't log, don't worry about it |
92 | } | 93 | } |
93 | } | 94 | } |
94 | 95 | ||