aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/NHibernateUserData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/NHibernate/NHibernateUserData.cs')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateUserData.cs25
1 files changed, 16 insertions, 9 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs
index 8983753..491cb2a 100644
--- a/OpenSim/Data/NHibernate/NHibernateUserData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs
@@ -85,11 +85,11 @@ namespace OpenSim.Data.NHibernate
85 85
86 private void InitDB() 86 private void InitDB()
87 { 87 {
88 string regex = @"no such table: Users"; 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(InventoryItemBase), LLUUID.Zero); 92 session.Load(typeof(UserProfileData), LLUUID.Zero);
93 } 93 }
94 } catch (ObjectNotFoundException e) { 94 } catch (ObjectNotFoundException e) {
95 // yes, we know it's not there, but that's ok 95 // yes, we know it's not there, but that's ok
@@ -104,11 +104,14 @@ namespace OpenSim.Data.NHibernate
104 104
105 private bool ExistsUser(LLUUID uuid) 105 private bool ExistsUser(LLUUID uuid)
106 { 106 {
107 UserProfileData user; 107 UserProfileData user = null;
108 using(ISession session = factory.OpenSession()) { 108 try {
109 user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; 109 using(ISession session = factory.OpenSession()) {
110 } 110 user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
111 return (user == null) ? false : true; 111 }
112 } catch (Exception e) {}
113
114 return (user != null);
112 } 115 }
113 116
114 override public UserProfileData GetUserByUUID(LLUUID uuid) 117 override public UserProfileData GetUserByUUID(LLUUID uuid)
@@ -201,8 +204,12 @@ namespace OpenSim.Data.NHibernate
201 204
202 override public UserAgentData GetAgentByUUID(LLUUID uuid) 205 override public UserAgentData GetAgentByUUID(LLUUID uuid)
203 { 206 {
204 using(ISession session = factory.OpenSession()) { 207 try {
205 return session.Load(typeof(UserAgentData), uuid) as UserAgentData; 208 using(ISession session = factory.OpenSession()) {
209 return session.Load(typeof(UserAgentData), uuid) as UserAgentData;
210 }
211 } catch {
212 return null;
206 } 213 }
207 } 214 }
208 215