aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorJeff Ames2008-05-14 05:11:23 +0000
committerJeff Ames2008-05-14 05:11:23 +0000
commitc995d60d37032db3198b8496e186aa7a892dc7a8 (patch)
tree826147e66f61c812897d9b0acdb16ebfeb30d4d3 /OpenSim/Data
parent* Added 3 warnings in response to the warnings. Adam, read the warnings. (diff)
downloadopensim-SC-c995d60d37032db3198b8496e186aa7a892dc7a8.zip
opensim-SC-c995d60d37032db3198b8496e186aa7a892dc7a8.tar.gz
opensim-SC-c995d60d37032db3198b8496e186aa7a892dc7a8.tar.bz2
opensim-SC-c995d60d37032db3198b8496e186aa7a892dc7a8.tar.xz
Formatting cleanup.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/Base/BaseDataReader.cs6
-rw-r--r--OpenSim/Data/Base/BaseTableMapper.cs10
-rw-r--r--OpenSim/Data/MSSQLMapper/MSSQLDatabaseMapper.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs2
-rw-r--r--OpenSim/Data/MySQLMapper/MySQLDatabaseMapper.cs2
-rw-r--r--OpenSim/Data/NHibernate/NHibernateAssetData.cs14
-rw-r--r--OpenSim/Data/NHibernate/NHibernateInventoryData.cs46
-rw-r--r--OpenSim/Data/NHibernate/NHibernateUserData.cs40
-rw-r--r--OpenSim/Data/PrimitiveBaseShapeTableMapper.cs4
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs2
11 files changed, 65 insertions, 65 deletions
diff --git a/OpenSim/Data/Base/BaseDataReader.cs b/OpenSim/Data/Base/BaseDataReader.cs
index da90f10..b71a966 100644
--- a/OpenSim/Data/Base/BaseDataReader.cs
+++ b/OpenSim/Data/Base/BaseDataReader.cs
@@ -117,7 +117,7 @@ namespace OpenSim.Data.Base
117 return m_source.GetGuid(m_source.GetOrdinal(name)); 117 return m_source.GetGuid(m_source.GetOrdinal(name));
118 } 118 }
119 119
120 public UInt32 GetUInt32(string name ) 120 public UInt32 GetUInt32(string name)
121 { 121 {
122 return (UInt32)GetInt32(name); 122 return (UInt32)GetInt32(name);
123 } 123 }
@@ -129,9 +129,9 @@ namespace OpenSim.Data.Base
129 return int32; 129 return int32;
130 } 130 }
131 131
132 public Int64 GetInt64(string name) 132 public Int64 GetInt64(string name)
133 { 133 {
134 int ordinal = m_source.GetOrdinal( name ); 134 int ordinal = m_source.GetOrdinal(name);
135 long int64 = m_source.GetInt64(ordinal); 135 long int64 = m_source.GetInt64(ordinal);
136 return int64; 136 return int64;
137 } 137 }
diff --git a/OpenSim/Data/Base/BaseTableMapper.cs b/OpenSim/Data/Base/BaseTableMapper.cs
index ad60009..649b228 100644
--- a/OpenSim/Data/Base/BaseTableMapper.cs
+++ b/OpenSim/Data/Base/BaseTableMapper.cs
@@ -125,7 +125,7 @@ namespace OpenSim.Data.Base
125 125
126 // HACK: This is a temporary function used by TryGetValue(). 126 // HACK: This is a temporary function used by TryGetValue().
127 // Due to a bug in mono 1.2.6, delegate blocks cannot contain 127 // Due to a bug in mono 1.2.6, delegate blocks cannot contain
128 // a using() block. This has been fixed in SVN, so the next 128 // a using block. This has been fixed in SVN, so the next
129 // mono release should work. 129 // mono release should work.
130 private void TryGetConnectionValue(DbConnection connection, TPrimaryKey primaryKey, ref TRowMapper result, ref bool success) 130 private void TryGetConnectionValue(DbConnection connection, TPrimaryKey primaryKey, ref TRowMapper result, ref bool success)
131 { 131 {
@@ -137,7 +137,7 @@ namespace OpenSim.Data.Base
137 { 137 {
138 if (reader.Read()) 138 if (reader.Read())
139 { 139 {
140 result = FromReader( CreateReader(reader)); 140 result = FromReader(CreateReader(reader));
141 success = true; 141 success = true;
142 } 142 }
143 else 143 else
@@ -165,7 +165,7 @@ namespace OpenSim.Data.Base
165 165
166 // HACK: This is a temporary function used by Remove(). 166 // HACK: This is a temporary function used by Remove().
167 // Due to a bug in mono 1.2.6, delegate blocks cannot contain 167 // Due to a bug in mono 1.2.6, delegate blocks cannot contain
168 // a using() block. This has been fixed in SVN, so the next 168 // a using block. This has been fixed in SVN, so the next
169 // mono release should work. 169 // mono release should work.
170 protected virtual void TryDelete(DbConnection connection, TPrimaryKey id, ref int deleted) 170 protected virtual void TryDelete(DbConnection connection, TPrimaryKey id, ref int deleted)
171 { 171 {
@@ -215,7 +215,7 @@ namespace OpenSim.Data.Base
215 215
216 // HACK: This is a temporary function used by Update(). 216 // HACK: This is a temporary function used by Update().
217 // Due to a bug in mono 1.2.6, delegate blocks cannot contain 217 // Due to a bug in mono 1.2.6, delegate blocks cannot contain
218 // a using() block. This has been fixed in SVN, so the next 218 // a using block. This has been fixed in SVN, so the next
219 // mono release should work. 219 // mono release should work.
220 protected void TryUpdate(DbConnection connection, TPrimaryKey primaryKey, TRowMapper value, ref int updated) 220 protected void TryUpdate(DbConnection connection, TPrimaryKey primaryKey, TRowMapper value, ref int updated)
221 { 221 {
@@ -246,7 +246,7 @@ namespace OpenSim.Data.Base
246 246
247 // HACK: This is a temporary function used by Add(). 247 // HACK: This is a temporary function used by Add().
248 // Due to a bug in mono 1.2.6, delegate blocks cannot contain 248 // Due to a bug in mono 1.2.6, delegate blocks cannot contain
249 // a using() block. This has been fixed in SVN, so the next 249 // a using block. This has been fixed in SVN, so the next
250 // mono release should work. 250 // mono release should work.
251 protected void TryAdd(DbConnection connection, TRowMapper value, ref int added) 251 protected void TryAdd(DbConnection connection, TRowMapper value, ref int added)
252 { 252 {
diff --git a/OpenSim/Data/MSSQLMapper/MSSQLDatabaseMapper.cs b/OpenSim/Data/MSSQLMapper/MSSQLDatabaseMapper.cs
index 4c807b1..bd683f3 100644
--- a/OpenSim/Data/MSSQLMapper/MSSQLDatabaseMapper.cs
+++ b/OpenSim/Data/MSSQLMapper/MSSQLDatabaseMapper.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Data.MSSQLMapper
46 46
47 public override object ConvertToDbType(object value) 47 public override object ConvertToDbType(object value)
48 { 48 {
49 if( value is UInt32 ) 49 if (value is UInt32)
50 { 50 {
51 UInt32 tmpVal = (UInt32) value; 51 UInt32 tmpVal = (UInt32) value;
52 Int64 result = Convert.ToInt64(tmpVal); 52 Int64 result = Convert.ToInt64(tmpVal);
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index 1f95aad..4455c3b 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -512,7 +512,7 @@ namespace OpenSim.Data.MySQL
512 retval.FirstLifeImage = tmp; 512 retval.FirstLifeImage = tmp;
513 } 513 }
514 514
515 if(reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) 515 if (reader.IsDBNull(reader.GetOrdinal("webLoginKey")))
516 { 516 {
517 retval.WebLoginKey = LLUUID.Zero; 517 retval.WebLoginKey = LLUUID.Zero;
518 } 518 }
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index b448715..ab34f15 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Data.MySQL
69 string settingPort = iniFile.ParseFileReadValue("port"); 69 string settingPort = iniFile.ParseFileReadValue("port");
70 70
71 m_usersTableName = iniFile.ParseFileReadValue("userstablename"); 71 m_usersTableName = iniFile.ParseFileReadValue("userstablename");
72 if( m_usersTableName == null ) 72 if (m_usersTableName == null)
73 { 73 {
74 m_usersTableName = "users"; 74 m_usersTableName = "users";
75 } 75 }
diff --git a/OpenSim/Data/MySQLMapper/MySQLDatabaseMapper.cs b/OpenSim/Data/MySQLMapper/MySQLDatabaseMapper.cs
index 37b94fa..b7940b8 100644
--- a/OpenSim/Data/MySQLMapper/MySQLDatabaseMapper.cs
+++ b/OpenSim/Data/MySQLMapper/MySQLDatabaseMapper.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Data.MySQLMapper
52 52
53 public override BaseDataReader CreateReader(IDataReader reader) 53 public override BaseDataReader CreateReader(IDataReader reader)
54 { 54 {
55 return new MySQLDataReader( reader ); 55 return new MySQLDataReader(reader);
56 } 56 }
57 } 57 }
58} \ No newline at end of file 58} \ No newline at end of file
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs
index e52f633..875f4e5 100644
--- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs
@@ -97,14 +97,14 @@ namespace OpenSim.Data.NHibernate
97 string regex = @"no such table: Assets"; 97 string regex = @"no such table: Assets";
98 Regex RE = new Regex(regex, RegexOptions.Multiline); 98 Regex RE = new Regex(regex, RegexOptions.Multiline);
99 try { 99 try {
100 using(ISession session = factory.OpenSession()) { 100 using (ISession session = factory.OpenSession()) {
101 session.Load(typeof(AssetBase), LLUUID.Zero); 101 session.Load(typeof(AssetBase), LLUUID.Zero);
102 } 102 }
103 } catch (ObjectNotFoundException) { 103 } catch (ObjectNotFoundException) {
104 // yes, we know it's not there, but that's ok 104 // yes, we know it's not there, but that's ok
105 } catch (ADOException e) { 105 } catch (ADOException e) {
106 Match m = RE.Match(e.ToString()); 106 Match m = RE.Match(e.ToString());
107 if(m.Success) { 107 if (m.Success) {
108 // We don't have this table, so create it. 108 // We don't have this table, so create it.
109 new SchemaExport(cfg).Create(true, true); 109 new SchemaExport(cfg).Create(true, true);
110 } 110 }
@@ -113,7 +113,7 @@ namespace OpenSim.Data.NHibernate
113 113
114 override public AssetBase FetchAsset(LLUUID uuid) 114 override public AssetBase FetchAsset(LLUUID uuid)
115 { 115 {
116 using(ISession session = factory.OpenSession()) { 116 using (ISession session = factory.OpenSession()) {
117 try { 117 try {
118 return session.Load(typeof(AssetBase), uuid) as AssetBase; 118 return session.Load(typeof(AssetBase), uuid) as AssetBase;
119 } catch { 119 } catch {
@@ -125,8 +125,8 @@ namespace OpenSim.Data.NHibernate
125 override public void CreateAsset(AssetBase asset) 125 override public void CreateAsset(AssetBase asset)
126 { 126 {
127 if (!ExistsAsset(asset.FullID)) { 127 if (!ExistsAsset(asset.FullID)) {
128 using(ISession session = factory.OpenSession()) { 128 using (ISession session = factory.OpenSession()) {
129 using(ITransaction transaction = session.BeginTransaction()) { 129 using (ITransaction transaction = session.BeginTransaction()) {
130 session.Save(asset); 130 session.Save(asset);
131 transaction.Commit(); 131 transaction.Commit();
132 } 132 }
@@ -137,8 +137,8 @@ namespace OpenSim.Data.NHibernate
137 override public void UpdateAsset(AssetBase asset) 137 override public void UpdateAsset(AssetBase asset)
138 { 138 {
139 if (ExistsAsset(asset.FullID)) { 139 if (ExistsAsset(asset.FullID)) {
140 using(ISession session = factory.OpenSession()) { 140 using (ISession session = factory.OpenSession()) {
141 using(ITransaction transaction = session.BeginTransaction()) { 141 using (ITransaction transaction = session.BeginTransaction()) {
142 session.Update(asset); 142 session.Update(asset);
143 transaction.Commit(); 143 transaction.Commit();
144 } 144 }
diff --git a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
index f8e3655..6ee1b4a 100644
--- a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
@@ -95,14 +95,14 @@ namespace OpenSim.Data.NHibernate
95 string regex = @"no such table: Inventory"; 95 string regex = @"no such table: Inventory";
96 Regex RE = new Regex(regex, RegexOptions.Multiline); 96 Regex RE = new Regex(regex, RegexOptions.Multiline);
97 try { 97 try {
98 using(ISession session = factory.OpenSession()) { 98 using (ISession session = factory.OpenSession()) {
99 session.Load(typeof(InventoryItemBase), LLUUID.Zero); 99 session.Load(typeof(InventoryItemBase), LLUUID.Zero);
100 } 100 }
101 } catch (ObjectNotFoundException) { 101 } catch (ObjectNotFoundException) {
102 // yes, we know it's not there, but that's ok 102 // yes, we know it's not there, but that's ok
103 } catch (ADOException e) { 103 } catch (ADOException e) {
104 Match m = RE.Match(e.ToString()); 104 Match m = RE.Match(e.ToString());
105 if(m.Success) { 105 if (m.Success) {
106 // We don't have this table, so create it. 106 // We don't have this table, so create it.
107 new SchemaExport(cfg).Create(true, true); 107 new SchemaExport(cfg).Create(true, true);
108 } 108 }
@@ -125,7 +125,7 @@ namespace OpenSim.Data.NHibernate
125 /// <returns>A class containing item information</returns> 125 /// <returns>A class containing item information</returns>
126 public InventoryItemBase getInventoryItem(LLUUID item) 126 public InventoryItemBase getInventoryItem(LLUUID item)
127 { 127 {
128 using(ISession session = factory.OpenSession()) { 128 using (ISession session = factory.OpenSession()) {
129 try { 129 try {
130 return session.Load(typeof(InventoryItemBase), item) as InventoryItemBase; 130 return session.Load(typeof(InventoryItemBase), item) as InventoryItemBase;
131 } catch { 131 } catch {
@@ -142,8 +142,8 @@ namespace OpenSim.Data.NHibernate
142 public void addInventoryItem(InventoryItemBase item) 142 public void addInventoryItem(InventoryItemBase item)
143 { 143 {
144 if (!ExistsItem(item.ID)) { 144 if (!ExistsItem(item.ID)) {
145 using(ISession session = factory.OpenSession()) { 145 using (ISession session = factory.OpenSession()) {
146 using(ITransaction transaction = session.BeginTransaction()) { 146 using (ITransaction transaction = session.BeginTransaction()) {
147 session.Save(item); 147 session.Save(item);
148 transaction.Commit(); 148 transaction.Commit();
149 } 149 }
@@ -161,8 +161,8 @@ namespace OpenSim.Data.NHibernate
161 public void updateInventoryItem(InventoryItemBase item) 161 public void updateInventoryItem(InventoryItemBase item)
162 { 162 {
163 if (ExistsItem(item.ID)) { 163 if (ExistsItem(item.ID)) {
164 using(ISession session = factory.OpenSession()) { 164 using (ISession session = factory.OpenSession()) {
165 using(ITransaction transaction = session.BeginTransaction()) { 165 using (ITransaction transaction = session.BeginTransaction()) {
166 session.Update(item); 166 session.Update(item);
167 transaction.Commit(); 167 transaction.Commit();
168 } 168 }
@@ -178,8 +178,8 @@ namespace OpenSim.Data.NHibernate
178 /// <param name="item"></param> 178 /// <param name="item"></param>
179 public void deleteInventoryItem(LLUUID itemID) 179 public void deleteInventoryItem(LLUUID itemID)
180 { 180 {
181 using(ISession session = factory.OpenSession()) { 181 using (ISession session = factory.OpenSession()) {
182 using(ITransaction transaction = session.BeginTransaction()) { 182 using (ITransaction transaction = session.BeginTransaction()) {
183 session.Delete(itemID); 183 session.Delete(itemID);
184 transaction.Commit(); 184 transaction.Commit();
185 } 185 }
@@ -194,7 +194,7 @@ namespace OpenSim.Data.NHibernate
194 /// <returns>A class containing folder information</returns> 194 /// <returns>A class containing folder information</returns>
195 public InventoryFolderBase getInventoryFolder(LLUUID folder) 195 public InventoryFolderBase getInventoryFolder(LLUUID folder)
196 { 196 {
197 using(ISession session = factory.OpenSession()) { 197 using (ISession session = factory.OpenSession()) {
198 try { 198 try {
199 return session.Load(typeof(InventoryFolderBase), folder) as InventoryFolderBase; 199 return session.Load(typeof(InventoryFolderBase), folder) as InventoryFolderBase;
200 } catch { 200 } catch {
@@ -211,8 +211,8 @@ namespace OpenSim.Data.NHibernate
211 public void addInventoryFolder(InventoryFolderBase folder) 211 public void addInventoryFolder(InventoryFolderBase folder)
212 { 212 {
213 if (!ExistsFolder(folder.ID)) { 213 if (!ExistsFolder(folder.ID)) {
214 using(ISession session = factory.OpenSession()) { 214 using (ISession session = factory.OpenSession()) {
215 using(ITransaction transaction = session.BeginTransaction()) { 215 using (ITransaction transaction = session.BeginTransaction()) {
216 session.Save(folder); 216 session.Save(folder);
217 transaction.Commit(); 217 transaction.Commit();
218 } 218 }
@@ -230,8 +230,8 @@ namespace OpenSim.Data.NHibernate
230 public void updateInventoryFolder(InventoryFolderBase folder) 230 public void updateInventoryFolder(InventoryFolderBase folder)
231 { 231 {
232 if (ExistsFolder(folder.ID)) { 232 if (ExistsFolder(folder.ID)) {
233 using(ISession session = factory.OpenSession()) { 233 using (ISession session = factory.OpenSession()) {
234 using(ITransaction transaction = session.BeginTransaction()) { 234 using (ITransaction transaction = session.BeginTransaction()) {
235 session.Update(folder); 235 session.Update(folder);
236 transaction.Commit(); 236 transaction.Commit();
237 } 237 }
@@ -247,8 +247,8 @@ namespace OpenSim.Data.NHibernate
247 /// <param name="folder"></param> 247 /// <param name="folder"></param>
248 public void deleteInventoryFolder(LLUUID folderID) 248 public void deleteInventoryFolder(LLUUID folderID)
249 { 249 {
250 using(ISession session = factory.OpenSession()) { 250 using (ISession session = factory.OpenSession()) {
251 using(ITransaction transaction = session.BeginTransaction()) { 251 using (ITransaction transaction = session.BeginTransaction()) {
252 session.Delete(folderID.ToString()); 252 session.Delete(folderID.ToString());
253 transaction.Commit(); 253 transaction.Commit();
254 } 254 }
@@ -324,10 +324,10 @@ namespace OpenSim.Data.NHibernate
324 /// <returns>A List of InventoryItemBase items</returns> 324 /// <returns>A List of InventoryItemBase items</returns>
325 public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID) 325 public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID)
326 { 326 {
327 using(ISession session = factory.OpenSession()) { 327 using (ISession session = factory.OpenSession()) {
328 // try { 328 // try {
329 ICriteria criteria = session.CreateCriteria(typeof(InventoryItemBase)); 329 ICriteria criteria = session.CreateCriteria(typeof(InventoryItemBase));
330 criteria.Add(Expression.Eq("Folder", folderID) ); 330 criteria.Add(Expression.Eq("Folder", folderID));
331 List<InventoryItemBase> list = new List<InventoryItemBase>(); 331 List<InventoryItemBase> list = new List<InventoryItemBase>();
332 foreach (InventoryItemBase item in criteria.List()) 332 foreach (InventoryItemBase item in criteria.List())
333 { 333 {
@@ -348,11 +348,11 @@ namespace OpenSim.Data.NHibernate
348 // see InventoryItemBase.getUserRootFolder 348 // see InventoryItemBase.getUserRootFolder
349 public InventoryFolderBase getUserRootFolder(LLUUID user) 349 public InventoryFolderBase getUserRootFolder(LLUUID user)
350 { 350 {
351 using(ISession session = factory.OpenSession()) { 351 using (ISession session = factory.OpenSession()) {
352 // try { 352 // try {
353 ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); 353 ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase));
354 criteria.Add(Expression.Eq("ParentID", LLUUID.Zero) ); 354 criteria.Add(Expression.Eq("ParentID", LLUUID.Zero));
355 criteria.Add(Expression.Eq("Owner", user) ); 355 criteria.Add(Expression.Eq("Owner", user));
356 foreach (InventoryFolderBase folder in criteria.List()) 356 foreach (InventoryFolderBase folder in criteria.List())
357 { 357 {
358 return folder; 358 return folder;
@@ -372,10 +372,10 @@ namespace OpenSim.Data.NHibernate
372 /// <param name="parentID">ID of parent</param> 372 /// <param name="parentID">ID of parent</param>
373 private void getInventoryFolders(ref List<InventoryFolderBase> folders, LLUUID parentID) 373 private void getInventoryFolders(ref List<InventoryFolderBase> folders, LLUUID parentID)
374 { 374 {
375 using(ISession session = factory.OpenSession()) { 375 using (ISession session = factory.OpenSession()) {
376 // try { 376 // try {
377 ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); 377 ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase));
378 criteria.Add(Expression.Eq("ParentID", parentID) ); 378 criteria.Add(Expression.Eq("ParentID", parentID));
379 foreach (InventoryFolderBase item in criteria.List()) 379 foreach (InventoryFolderBase item in criteria.List())
380 { 380 {
381 folders.Add(item); 381 folders.Add(item);
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs
index e680840..2c84ef9 100644
--- a/OpenSim/Data/NHibernate/NHibernateUserData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs
@@ -88,14 +88,14 @@ namespace OpenSim.Data.NHibernate
88 string regex = @"no such table: UserProfiles"; 88 string regex = @"no such table: UserProfiles";
89 Regex RE = new Regex(regex, RegexOptions.Multiline); 89 Regex RE = new Regex(regex, RegexOptions.Multiline);
90 try { 90 try {
91 using(ISession session = factory.OpenSession()) { 91 using (ISession session = factory.OpenSession()) {
92 session.Load(typeof(UserProfileData), LLUUID.Zero); 92 session.Load(typeof(UserProfileData), LLUUID.Zero);
93 } 93 }
94 } catch (ObjectNotFoundException) { 94 } catch (ObjectNotFoundException) {
95 // yes, we know it's not there, but that's ok 95 // yes, we know it's not there, but that's ok
96 } catch (ADOException e) { 96 } catch (ADOException e) {
97 Match m = RE.Match(e.ToString()); 97 Match m = RE.Match(e.ToString());
98 if(m.Success) { 98 if (m.Success) {
99 // We don't have this table, so create it. 99 // We don't have this table, so create it.
100 new SchemaExport(cfg).Create(true, true); 100 new SchemaExport(cfg).Create(true, true);
101 } 101 }
@@ -106,7 +106,7 @@ namespace OpenSim.Data.NHibernate
106 { 106 {
107 UserProfileData user = null; 107 UserProfileData user = null;
108 try { 108 try {
109 using(ISession session = factory.OpenSession()) { 109 using (ISession session = factory.OpenSession()) {
110 user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; 110 user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
111 } 111 }
112 // BUG: CATCHALL IS BAD. 112 // BUG: CATCHALL IS BAD.
@@ -119,7 +119,7 @@ namespace OpenSim.Data.NHibernate
119 { 119 {
120 UserProfileData user; 120 UserProfileData user;
121 // TODO: I'm sure I'll have to do something silly here 121 // TODO: I'm sure I'll have to do something silly here
122 using(ISession session = factory.OpenSession()) { 122 using (ISession session = factory.OpenSession()) {
123 user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; 123 user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
124 user.CurrentAgent = GetAgentByUUID(uuid); 124 user.CurrentAgent = GetAgentByUUID(uuid);
125 } 125 }
@@ -129,8 +129,8 @@ namespace OpenSim.Data.NHibernate
129 override public void AddNewUserProfile(UserProfileData profile) 129 override public void AddNewUserProfile(UserProfileData profile)
130 { 130 {
131 if (!ExistsUser(profile.ID)) { 131 if (!ExistsUser(profile.ID)) {
132 using(ISession session = factory.OpenSession()) { 132 using (ISession session = factory.OpenSession()) {
133 using(ITransaction transaction = session.BeginTransaction()) { 133 using (ITransaction transaction = session.BeginTransaction()) {
134 session.Save(profile); 134 session.Save(profile);
135 SetAgentData(profile.ID, profile.CurrentAgent, session); 135 SetAgentData(profile.ID, profile.CurrentAgent, session);
136 // TODO: save agent 136 // TODO: save agent
@@ -166,8 +166,8 @@ namespace OpenSim.Data.NHibernate
166 override public bool UpdateUserProfile(UserProfileData profile) 166 override public bool UpdateUserProfile(UserProfileData profile)
167 { 167 {
168 if (ExistsUser(profile.ID)) { 168 if (ExistsUser(profile.ID)) {
169 using(ISession session = factory.OpenSession()) { 169 using (ISession session = factory.OpenSession()) {
170 using(ITransaction transaction = session.BeginTransaction()) { 170 using (ITransaction transaction = session.BeginTransaction()) {
171 session.Update(profile); 171 session.Update(profile);
172 SetAgentData(profile.ID, profile.CurrentAgent, session); 172 SetAgentData(profile.ID, profile.CurrentAgent, session);
173 transaction.Commit(); 173 transaction.Commit();
@@ -183,8 +183,8 @@ namespace OpenSim.Data.NHibernate
183 183
184 override public void AddNewUserAgent(UserAgentData agent) 184 override public void AddNewUserAgent(UserAgentData agent)
185 { 185 {
186 using(ISession session = factory.OpenSession()) { 186 using (ISession session = factory.OpenSession()) {
187 using(ITransaction transaction = session.BeginTransaction()) { 187 using (ITransaction transaction = session.BeginTransaction()) {
188 session.Save(agent); 188 session.Save(agent);
189 transaction.Commit(); 189 transaction.Commit();
190 } 190 }
@@ -193,8 +193,8 @@ namespace OpenSim.Data.NHibernate
193 193
194 public void UpdateUserAgent(UserAgentData agent) 194 public void UpdateUserAgent(UserAgentData agent)
195 { 195 {
196 using(ISession session = factory.OpenSession()) { 196 using (ISession session = factory.OpenSession()) {
197 using(ITransaction transaction = session.BeginTransaction()) { 197 using (ITransaction transaction = session.BeginTransaction()) {
198 session.Update(agent); 198 session.Update(agent);
199 transaction.Commit(); 199 transaction.Commit();
200 } 200 }
@@ -206,7 +206,7 @@ namespace OpenSim.Data.NHibernate
206 override public UserAgentData GetAgentByUUID(LLUUID uuid) 206 override public UserAgentData GetAgentByUUID(LLUUID uuid)
207 { 207 {
208 try { 208 try {
209 using(ISession session = factory.OpenSession()) { 209 using (ISession session = factory.OpenSession()) {
210 return session.Load(typeof(UserAgentData), uuid) as UserAgentData; 210 return session.Load(typeof(UserAgentData), uuid) as UserAgentData;
211 } 211 }
212 } catch { 212 } catch {
@@ -216,7 +216,7 @@ namespace OpenSim.Data.NHibernate
216 216
217 override public UserProfileData GetUserByName(string fname, string lname) 217 override public UserProfileData GetUserByName(string fname, string lname)
218 { 218 {
219 using(ISession session = factory.OpenSession()) { 219 using (ISession session = factory.OpenSession()) {
220 ICriteria criteria = session.CreateCriteria(typeof(UserProfileData)); 220 ICriteria criteria = session.CreateCriteria(typeof(UserProfileData));
221 criteria.Add(Expression.Eq("FirstName", fname)); 221 criteria.Add(Expression.Eq("FirstName", fname));
222 criteria.Add(Expression.Eq("SurName", lname)); 222 criteria.Add(Expression.Eq("SurName", lname));
@@ -247,11 +247,11 @@ namespace OpenSim.Data.NHibernate
247 247
248 if (querysplit.Length == 2) 248 if (querysplit.Length == 2)
249 { 249 {
250 using(ISession session = factory.OpenSession()) { 250 using (ISession session = factory.OpenSession()) {
251 ICriteria criteria = session.CreateCriteria(typeof(UserProfileData)); 251 ICriteria criteria = session.CreateCriteria(typeof(UserProfileData));
252 criteria.Add(Expression.Like("FirstName", querysplit[0])); 252 criteria.Add(Expression.Like("FirstName", querysplit[0]));
253 criteria.Add(Expression.Like("SurName", querysplit[1])); 253 criteria.Add(Expression.Like("SurName", querysplit[1]));
254 foreach(UserProfileData profile in criteria.List()) 254 foreach (UserProfileData profile in criteria.List())
255 { 255 {
256 AvatarPickerAvatar user = new AvatarPickerAvatar(); 256 AvatarPickerAvatar user = new AvatarPickerAvatar();
257 user.AvatarID = profile.ID; 257 user.AvatarID = profile.ID;
@@ -280,7 +280,7 @@ namespace OpenSim.Data.NHibernate
280 { 280 {
281 UserAppearance appearance; 281 UserAppearance appearance;
282 // TODO: I'm sure I'll have to do something silly here 282 // TODO: I'm sure I'll have to do something silly here
283 using(ISession session = factory.OpenSession()) { 283 using (ISession session = factory.OpenSession()) {
284 appearance = session.Load(typeof(UserAppearance), user) as UserAppearance; 284 appearance = session.Load(typeof(UserAppearance), user) as UserAppearance;
285 } 285 }
286 return appearance; 286 return appearance;
@@ -289,7 +289,7 @@ namespace OpenSim.Data.NHibernate
289 private bool ExistsAppearance(LLUUID uuid) 289 private bool ExistsAppearance(LLUUID uuid)
290 { 290 {
291 UserAppearance appearance; 291 UserAppearance appearance;
292 using(ISession session = factory.OpenSession()) { 292 using (ISession session = factory.OpenSession()) {
293 appearance = session.Load(typeof(UserAppearance), uuid) as UserAppearance; 293 appearance = session.Load(typeof(UserAppearance), uuid) as UserAppearance;
294 } 294 }
295 return (appearance == null) ? false : true; 295 return (appearance == null) ? false : true;
@@ -299,8 +299,8 @@ namespace OpenSim.Data.NHibernate
299 override public void UpdateUserAppearance(LLUUID user, UserAppearance appearance) 299 override public void UpdateUserAppearance(LLUUID user, UserAppearance appearance)
300 { 300 {
301 bool exists = ExistsAppearance(user); 301 bool exists = ExistsAppearance(user);
302 using(ISession session = factory.OpenSession()) { 302 using (ISession session = factory.OpenSession()) {
303 using(ITransaction transaction = session.BeginTransaction()) { 303 using (ITransaction transaction = session.BeginTransaction()) {
304 if (exists) { 304 if (exists) {
305 session.Update(appearance); 305 session.Update(appearance);
306 } else { 306 } else {
diff --git a/OpenSim/Data/PrimitiveBaseShapeTableMapper.cs b/OpenSim/Data/PrimitiveBaseShapeTableMapper.cs
index fe49978..cb3d33d 100644
--- a/OpenSim/Data/PrimitiveBaseShapeTableMapper.cs
+++ b/OpenSim/Data/PrimitiveBaseShapeTableMapper.cs
@@ -143,7 +143,7 @@ namespace OpenSim.Data
143 PrimitiveBaseShape shape = new PrimitiveBaseShape(); 143 PrimitiveBaseShape shape = new PrimitiveBaseShape();
144 144
145 PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper(m_schema, shape); 145 PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper(m_schema, shape);
146 mapper.FillObject( reader ); 146 mapper.FillObject(reader);
147 147
148 return mapper; 148 return mapper;
149 } 149 }
@@ -162,7 +162,7 @@ namespace OpenSim.Data
162 162
163 private PrimitiveBaseShapeRowMapper CreateRowMapper(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape) 163 private PrimitiveBaseShapeRowMapper CreateRowMapper(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape)
164 { 164 {
165 PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper( m_schema, primitiveBaseShape ); 165 PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper(m_schema, primitiveBaseShape);
166 mapper.SceneObjectPartId = sceneObjectPartId; 166 mapper.SceneObjectPartId = sceneObjectPartId;
167 return mapper; 167 return mapper;
168 } 168 }
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index fa5d5e2..f3a4bd1 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Data.SQLite
155 cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid))); 155 cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid)));
156 using (IDataReader reader = cmd.ExecuteReader()) 156 using (IDataReader reader = cmd.ExecuteReader())
157 { 157 {
158 if(reader.Read()) 158 if (reader.Read())
159 { 159 {
160 reader.Close(); 160 reader.Close();
161 return true; 161 return true;