diff options
author | Justin Clark-Casey (justincc) | 2010-04-23 20:56:24 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-04-23 20:56:24 +0100 |
commit | 6e99e5b47a2d792cca46a55789ca56de9fb45ef2 (patch) | |
tree | 63fe3ff4a5a251d42ec8aeafc61f7463fa64c2d2 | |
parent | Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-6e99e5b47a2d792cca46a55789ca56de9fb45ef2.zip opensim-SC_OLD-6e99e5b47a2d792cca46a55789ca56de9fb45ef2.tar.gz opensim-SC_OLD-6e99e5b47a2d792cca46a55789ca56de9fb45ef2.tar.bz2 opensim-SC_OLD-6e99e5b47a2d792cca46a55789ca56de9fb45ef2.tar.xz |
get region prim saving working properly in SQLiteNG
it wasn't working because of debug work that I'd forgotton to take out
-rw-r--r-- | OpenSim/Data/SQLiteNG/SQLiteRegionData.cs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Data/SQLiteNG/SQLiteRegionData.cs b/OpenSim/Data/SQLiteNG/SQLiteRegionData.cs index ee454db..289d626 100644 --- a/OpenSim/Data/SQLiteNG/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLiteNG/SQLiteRegionData.cs | |||
@@ -98,10 +98,7 @@ namespace OpenSim.Data.SQLiteNG | |||
98 | m_conn.Open(); | 98 | m_conn.Open(); |
99 | 99 | ||
100 | SqliteCommand primSelectCmd = new SqliteCommand(primSelect, m_conn); | 100 | SqliteCommand primSelectCmd = new SqliteCommand(primSelect, m_conn); |
101 | //SqliteCommand primSelectCmd = new SqliteCommand(primSelect, m_conn); | 101 | primDa = new SqliteDataAdapter(primSelectCmd); |
102 | //primDa = new SqliteDataAdapter(primSelectCmd); | ||
103 | primDa = new SqliteDataAdapter(primSelect, m_connectionString); | ||
104 | // SqliteCommandBuilder primCb = new SqliteCommandBuilder(primDa); | ||
105 | 102 | ||
106 | SqliteCommand shapeSelectCmd = new SqliteCommand(shapeSelect, m_conn); | 103 | SqliteCommand shapeSelectCmd = new SqliteCommand(shapeSelect, m_conn); |
107 | shapeDa = new SqliteDataAdapter(shapeSelectCmd); | 104 | shapeDa = new SqliteDataAdapter(shapeSelectCmd); |
@@ -128,17 +125,14 @@ namespace OpenSim.Data.SQLiteNG | |||
128 | 125 | ||
129 | lock (ds) | 126 | lock (ds) |
130 | { | 127 | { |
131 | //ds.Tables.Add(createPrimTable()); | 128 | ds.Tables.Add(createPrimTable()); |
132 | //setupPrimCommands(primDa, m_conn); | 129 | setupPrimCommands(primDa, m_conn); |
133 | //primDa.Fill(ds.Tables["prims"]); | ||
134 | primDa.Fill(ds, "prims"); | ||
135 | 130 | ||
136 | ds.Tables.Add(createShapeTable()); | 131 | ds.Tables.Add(createShapeTable()); |
137 | setupShapeCommands(shapeDa, m_conn); | 132 | setupShapeCommands(shapeDa, m_conn); |
138 | 133 | ||
139 | ds.Tables.Add(createItemsTable()); | 134 | ds.Tables.Add(createItemsTable()); |
140 | setupItemsCommands(itemsDa, m_conn); | 135 | setupItemsCommands(itemsDa, m_conn); |
141 | itemsDa.Fill(ds.Tables["primitems"]); | ||
142 | 136 | ||
143 | ds.Tables.Add(createTerrainTable()); | 137 | ds.Tables.Add(createTerrainTable()); |
144 | setupTerrainCommands(terrainDa, m_conn); | 138 | setupTerrainCommands(terrainDa, m_conn); |
@@ -150,7 +144,6 @@ namespace OpenSim.Data.SQLiteNG | |||
150 | setupLandAccessCommands(landAccessListDa, m_conn); | 144 | setupLandAccessCommands(landAccessListDa, m_conn); |
151 | 145 | ||
152 | ds.Tables.Add(createRegionSettingsTable()); | 146 | ds.Tables.Add(createRegionSettingsTable()); |
153 | |||
154 | setupRegionSettingsCommands(regionSettingsDa, m_conn); | 147 | setupRegionSettingsCommands(regionSettingsDa, m_conn); |
155 | 148 | ||
156 | // WORKAROUND: This is a work around for sqlite on | 149 | // WORKAROUND: This is a work around for sqlite on |
@@ -159,6 +152,15 @@ namespace OpenSim.Data.SQLiteNG | |||
159 | // need to actually find a proper way to handle this. | 152 | // need to actually find a proper way to handle this. |
160 | try | 153 | try |
161 | { | 154 | { |
155 | primDa.Fill(ds.Tables["prims"]); | ||
156 | } | ||
157 | catch (Exception) | ||
158 | { | ||
159 | m_log.Info("[REGION DB]: Caught fill error on prims table"); | ||
160 | } | ||
161 | |||
162 | try | ||
163 | { | ||
162 | shapeDa.Fill(ds.Tables["primshapes"]); | 164 | shapeDa.Fill(ds.Tables["primshapes"]); |
163 | } | 165 | } |
164 | catch (Exception) | 166 | catch (Exception) |
@@ -204,6 +206,7 @@ namespace OpenSim.Data.SQLiteNG | |||
204 | 206 | ||
205 | // We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values! | 207 | // We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values! |
206 | // Not sure exactly why this is - this kind of thing was not necessary before - justincc 20100409 | 208 | // Not sure exactly why this is - this kind of thing was not necessary before - justincc 20100409 |
209 | // Possibly because we manually set up our own DataTables before connecting to the database | ||
207 | CreateDataSetMapping(primDa, "prims"); | 210 | CreateDataSetMapping(primDa, "prims"); |
208 | CreateDataSetMapping(shapeDa, "primshapes"); | 211 | CreateDataSetMapping(shapeDa, "primshapes"); |
209 | CreateDataSetMapping(itemsDa, "primitems"); | 212 | CreateDataSetMapping(itemsDa, "primitems"); |