diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index 8983753008..491cb2a31b 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs @@ -85,11 +85,11 @@ namespace OpenSim.Data.NHibernate private void InitDB() { - string regex = @"no such table: Users"; + string regex = @"no such table: UserProfiles"; Regex RE = new Regex(regex, RegexOptions.Multiline); try { using(ISession session = factory.OpenSession()) { - session.Load(typeof(InventoryItemBase), LLUUID.Zero); + session.Load(typeof(UserProfileData), LLUUID.Zero); } } catch (ObjectNotFoundException e) { // yes, we know it's not there, but that's ok @@ -104,11 +104,14 @@ namespace OpenSim.Data.NHibernate private bool ExistsUser(LLUUID uuid) { - UserProfileData user; - using(ISession session = factory.OpenSession()) { - user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; - } - return (user == null) ? false : true; + UserProfileData user = null; + try { + using(ISession session = factory.OpenSession()) { + user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; + } + } catch (Exception e) {} + + return (user != null); } override public UserProfileData GetUserByUUID(LLUUID uuid) @@ -201,8 +204,12 @@ namespace OpenSim.Data.NHibernate override public UserAgentData GetAgentByUUID(LLUUID uuid) { - using(ISession session = factory.OpenSession()) { - return session.Load(typeof(UserAgentData), uuid) as UserAgentData; + try { + using(ISession session = factory.OpenSession()) { + return session.Load(typeof(UserAgentData), uuid) as UserAgentData; + } + } catch { + return null; } } diff --git a/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml index a642ae8b50..b2abeaef39 100644 --- a/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml +++ b/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml @@ -1,6 +1,6 @@ - + diff --git a/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml index 0eabf0ee98..85d888d09d 100644 --- a/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml +++ b/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml @@ -1,6 +1,6 @@ - + diff --git a/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml index 572916a8e8..3e4b5aa26c 100644 --- a/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml +++ b/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml @@ -1,6 +1,6 @@ - +