I wonder if the problem is your table name...'user' is a keyword I
believe...just a guess

On Dec 28, 3:40 pm, nitrous <[email protected]> wrote:
> All,
>
> I am wirtting here because I am at a complete loss as to how to
> resolve this.  I am getting the following error and I believe its with
> a specific .Net object, but I am not completely sure.
>
> The program '[4304] DatabaseGenerationTool.vshost.exe: Managed' has
> exited with code -2147023895 (0x800703e9).
>
> The object that I am using is a user object, which is posted below.
> As part of the application I'm working on I need to authenticate the
> user against an entry in an MSSQL 2008 DB.  The call to authenticate
> is crashing my managed application every time in ther exact same
> place.  However the crash only happens when I am debugging the code.
> If I am not debugging, everything runs through just fine without any
> issues.  This makes it impossible to debug any code.  I recently
> update to Windows 7 as well as from 2.01GA to 2.12GA and made some
> small code adjustments around the same time.  (all of this at once was
> a bad idea...)
>
> This section of code used to work even when debugging so Im not quite
> sure what happened.
>
> Here is my code:
>
> public UserInfo AuthenticateUser(string sLogin, string sPassword)
> {
>     UserInfo oUserInfo = Get(sLogin);
>     return AuthenticateUser(oUserInfo, sPassword);
>
> }
>
> public UserInfo Get(string sLogin)
> {
>     using (ISession oSession =
> SessionProvider.Instance.GetAuditableSession())
>         return oSession.CreateCriteria<UserInfo>().Add(Expression.Eq
> ("Login", sLogin)).UniqueResult<UserInfo>();
>
> }
>
> private UserInfo AuthenticateUser(UserInfo oUserInfo, string
> sPassword)
> {
>
> }
>
> I did not put any code into the private version of authenticate as the
> method is never actually hit before the application crashes.
> Everything looks OK and the Call to Get works perfectly as I can see
> the SQL output in the log4net console logging. There are no exceptions
> being thrown that are not caught up until this point.
>
> Hopefully my mapping is correct as I am trying to create an employee
> structure by mapping a tree.  Either way here it is:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
>                                    assembly="DataType"
>                                    namespace="DataType.Security"
>                                    default-lazy="false"
>                                    default-cascade="all">
>
>   <class name="UserInfo" table="user" dynamic-insert="true">
>     <id name="Id" column="userid" access="nosetter.pascalcase-m-
> underscore">
>       <generator class="guid" />
>     </id>
>     <property name="Login" length="50" not-null="true" unique="true" /
>
>     <property name="IsSystemAdministrator" insert="false"
> update="false" access="nosetter.pascalcase-m-underscore" />
>     <property name="FirstName" length="100" not-null="true" />
>     <property name="MiddleName" length="100" />
>     <property name="LastName" length="100" not-null="true" />
>     <property name="Email" length="100" />
>     <property name="Phone" length="10" not-null="true" />
>     <property name="MobilePhone" length="10" />
>     <property name="Fax" length="10" />
>     <property name="Enabled" not-null="true" />
>     <many-to-one name="Superior" class="UserInfo" column="superiorid"
> cascade="none" />
>     <bag name="Employees" cascade="none">
>       <key column="superiorid" foreign-key="fk_employees_superior"/>
>       <one-to-many class="UserInfo" not-found="ignore" />
>     </bag>
>     <property name="SalesNumber" length="20" />
>     <property name="CompanyName" length="100" />
>     <property name="Commission" scale="10" />
>     <bag name="SecurityRoles" table="usersecurityrolemap"
> cascade="none">
>       <key column="userid" foreign-key="FK_user_securityrole1" />
>       <many-to-many class="SecurityRole" column="securityroleid"
> foreign-key="FK_user_securityrole2" not-found="ignore" />
>     </bag>
>     <property name="CreateDate" generated="insert" update="false"
> access="nosetter.pascalcase-m-underscore" />
>
>     <joined-subclass name="User" table="usersecuritydata">
>       <key column="id" foreign-key="user_usersecuritydata" on-
> delete="cascade" />
>       <property name="Password" insert="false" update="false"
> length="50" access="nosetter.pascalcase-m-underscore" />
>       <property name="PasswordExpiresDate" insert="false"
> update="false" access="nosetter.pascalcase-m-underscore" />
>       <bag name="SecretQuestions" table="secretquestion" cascade="all-
> delete-orphan" order-by="secretquestionid DESC"
> access="nosetter.pascalcase-m-underscore">
>         <key column="userid" foreign-key="FK_user_secretquestion" />
>         <one-to-many class="SecretQuestion" not-found="ignore" />
>       </bag>
>     </joined-subclass>
>
>   </class>
>
> </hibernate-mapping>
>
> Does anyone have any ideas?  I did a bunch of research and saw a few
> links that mentioned a stack overflow, but All i see in the output
> window is:
>
> 12/28/2009 Info: Refreshing the lookup cache.
> 'DatabaseGenerationTool.vshost.exe' (Managed): Loaded 'D:\Users\mbell
> \Documents\Development\VS.Net 2005\Solutions\Certegy
> \DatabaseGenerationTool\bin\Debug\Antlr3.Runtime.dll'
>
> ... Select to go get the user from the DB (omitted because of the
> massive amounts of logging) ...
>
> The program '[4304] DatabaseGenerationTool.vshost.exe: Managed' has
> exited with code -2147023895 (0x800703e9).
>
> To me it appears that NHibernate is crashing but any help would be
> appreciated!
>
> Thanks in advance!

--

You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.


Reply via email to