aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2007-11-13 15:50:56 +0000
committerSean Dague2007-11-13 15:50:56 +0000
commit4bc4844646e3162ae3121619438732b48bbfe0ca (patch)
treede8267b617d061e21720429f9f9ceb1cf61ffd53
parentsome changes to reduce memory significantly by not keeping all (diff)
downloadopensim-SC_OLD-4bc4844646e3162ae3121619438732b48bbfe0ca.zip
opensim-SC_OLD-4bc4844646e3162ae3121619438732b48bbfe0ca.tar.gz
opensim-SC_OLD-4bc4844646e3162ae3121619438732b48bbfe0ca.tar.bz2
opensim-SC_OLD-4bc4844646e3162ae3121619438732b48bbfe0ca.tar.xz
working now. Needs cleanup, but I'll have to do that after the next meeting
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs23
1 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
index 4aff606..dcd6609 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
@@ -252,12 +252,13 @@ namespace OpenSim.DataStore.MonoSqlite
252 lock (ds) 252 lock (ds)
253 { 253 {
254 SqliteCommand cmd = new SqliteCommand("insert into terrain(RegionUUID, Revision, Heightfield)" + 254 SqliteCommand cmd = new SqliteCommand("insert into terrain(RegionUUID, Revision, Heightfield)" +
255 "values(:RegionUUID, :Revision, :Heightfield)", conn); 255 " values(:RegionUUID, :Revision, :Heightfield)", conn);
256 using(cmd) 256 using(cmd)
257 { 257 {
258 cmd.Parameters.Add(":RegionUUID", regionID); 258
259 cmd.Parameters.Add(":Revision", revision); 259 cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
260 cmd.Parameters.Add(":Heightfield", serializeTerrain(ter)); 260 cmd.Parameters.Add(new SqliteParameter(":Revision", revision));
261 cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter)));
261 cmd.ExecuteNonQuery(); 262 cmd.ExecuteNonQuery();
262 } 263 }
263 } 264 }
@@ -269,10 +270,11 @@ namespace OpenSim.DataStore.MonoSqlite
269 terret.Initialize(); 270 terret.Initialize();
270 271
271 SqliteCommand cmd = new SqliteCommand("select RegionUUID, Revision, Heightfield from terrain" + 272 SqliteCommand cmd = new SqliteCommand("select RegionUUID, Revision, Heightfield from terrain" +
272 "where RegionUUID=:RegionUUID order by Revision desc limit 1", conn); 273 " where RegionUUID=:RegionUUID order by Revision desc limit 1", conn);
273 cmd.Parameters.Add(":RegionUUID", regionID); 274 SqliteParameter param = new SqliteParameter();
275 cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
274 276
275 using (SqliteDataReader row = cmd.ExecuteReader(CommandBehavior.SingleRow)) 277 using (SqliteDataReader row = cmd.ExecuteReader())
276 { 278 {
277 int rev = 0; 279 int rev = 0;
278 if (row.Read()) 280 if (row.Read())
@@ -852,6 +854,13 @@ namespace OpenSim.DataStore.MonoSqlite
852 param.SourceVersion = DataRowVersion.Current; 854 param.SourceVersion = DataRowVersion.Current;
853 return param; 855 return param;
854 } 856 }
857
858 private SqliteParameter createParamWithValue(string name, Type type, Object o)
859 {
860 SqliteParameter param = createSqliteParameter(name, type);
861 param.Value = o;
862 return param;
863 }
855 864
856 private void setupPrimCommands(SqliteDataAdapter da, SqliteConnection conn) 865 private void setupPrimCommands(SqliteDataAdapter da, SqliteConnection conn)
857 { 866 {