aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2008-05-02 19:57:35 +0000
committerSean Dague2008-05-02 19:57:35 +0000
commite538a34accb1032ac738eb18fe998aae1afc652d (patch)
tree4e45721c84be557b39d99fc148cf5aa06f9edcc3
parentin theory fix the user table mapping (diff)
downloadopensim-SC-e538a34accb1032ac738eb18fe998aae1afc652d.zip
opensim-SC-e538a34accb1032ac738eb18fe998aae1afc652d.tar.gz
opensim-SC-e538a34accb1032ac738eb18fe998aae1afc652d.tar.bz2
opensim-SC-e538a34accb1032ac738eb18fe998aae1afc652d.tar.xz
fixed up a bunch of the nhibernate user driver. Friends are not
implemented, and something is still funny with agents, but this at least got me logged in, so is good enough to plumb through appearance and see how that goes.
-rw-r--r--OpenSim/Data/NHibernate/NHibernateUserData.cs25
-rw-r--r--OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml2
-rw-r--r--OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml2
-rw-r--r--OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml2
4 files changed, 19 insertions, 12 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
diff --git a/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml
index a642ae8..b2abeae 100644
--- a/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml
@@ -1,6 +1,6 @@
1<?xml version="1.0" encoding="utf-8" ?> 1<?xml version="1.0" encoding="utf-8" ?>
2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> 2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
3 <class name="OpenSim.Framework.UserAgentData, OpenSim.Framework" table="Users" lazy="false"> 3 <class name="OpenSim.Framework.UserAgentData, OpenSim.Framework" table="UserAgents" lazy="false">
4 <id name="ProfileID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"> 4 <id name="ProfileID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate">
5 <generator class="assigned" /> 5 <generator class="assigned" />
6 </id> 6 </id>
diff --git a/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml
index 0eabf0e..85d888d 100644
--- a/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml
@@ -1,6 +1,6 @@
1<?xml version="1.0" encoding="utf-8" ?> 1<?xml version="1.0" encoding="utf-8" ?>
2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> 2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
3 <class name="OpenSim.Framework.UserAppearance, OpenSim.Framework" table="Users" lazy="false"> 3 <class name="OpenSim.Framework.UserAppearance, OpenSim.Framework" table="UserAppearances" lazy="false">
4 <id name="User" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"> 4 <id name="User" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate">
5 <generator class="assigned" /> 5 <generator class="assigned" />
6 </id> 6 </id>
diff --git a/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml
index 572916a..3e4b5aa 100644
--- a/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml
@@ -1,6 +1,6 @@
1<?xml version="1.0" encoding="utf-8" ?> 1<?xml version="1.0" encoding="utf-8" ?>
2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> 2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
3 <class name="OpenSim.Framework.UserProfileData, OpenSim.Framework" table="Users" lazy="false"> 3 <class name="OpenSim.Framework.UserProfileData, OpenSim.Framework" table="UserProfiles" lazy="false">
4 <id name="ID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"> 4 <id name="ID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate">
5 <generator class="assigned" /> 5 <generator class="assigned" />
6 </id> 6 </id>