User creation problem using Nhibernate membership provider and Oracle10g

Topics: Developer Forum, Project Management Forum, User Forum
Nov 10, 2008 at 4:38 AM

Hi EverybodY

I tried to implement the asp.net user and role management feature using nhibernatemembership provider and Oracle10g,there is a problem
in user creation.
The problem is as follow....

NHibernateProvider: unable to get user; operation failed with error "could not execute query
[ select user0_.Id as Id1_, user0_.Name as Name1_, user0_.LoweredName as LoweredN3_1_, user0_.Description as Descript4_1_, user0_."Password" as Password5_1_, user0_.PasswordFormat as Password6_1_, user0_.PasswordSalt as Password7_1_, user0_.Email as Email1_, user0_.LoweredEmail as LoweredE9_1_, user0_.PasswordQuestion as Passwor10_1_, user0_.PasswordAnswer as Passwor11_1_, user0_.Comments as Comments1_, user0_.IsApproved as IsApproved1_, user0_.IsLockedOut as IsLocke14_1_, user0_.CreationDate as Creatio15_1_, user0_.LastActivityDate as LastAct16_1_, user0_.LastLoginDate as LastLog17_1_, user0_.LastLockedOutDate as LastLoc18_1_, user0_.LastPasswordChangeDate as LastPas19_1_, user0_.FailedPwdAttemptCnt as FailedP20_1_, user0_.FailedPwdAttemptWndStart as FailedP21_1_, user0_.FailedPwdAnsAttemptCnt as FailedP22_1_, user0_.FailedPwdAnsAttemptWndStart as FailedP23_1_ from MembershipUser user0_ where (user0_.LoweredName=? ) ]
Positional parameters:   0 sdfd
[SQL: select user0_.Id as Id1_, user0_.Name as Name1_, user0_.LoweredName as LoweredN3_1_, user0_.Description as Descript4_1_, user0_."Password" as Password5_1_, user0_.PasswordFormat as Password6_1_, user0_.PasswordSalt as Password7_1_, user0_.Email as Email1_, user0_.LoweredEmail as LoweredE9_1_, user0_.PasswordQuestion as Passwor10_1_, user0_.PasswordAnswer as Passwor11_1_, user0_.Comments as Comments1_, user0_.IsApproved as IsApproved1_, user0_.IsLockedOut as IsLocke14_1_, user0_.CreationDate as Creatio15_1_, user0_.LastActivityDate as LastAct16_1_, user0_.LastLoginDate as LastLog17_1_, user0_.LastLockedOutDate as LastLoc18_1_, user0_.LastPasswordChangeDate as LastPas19_1_, user0_.FailedPwdAttemptCnt as FailedP20_1_, user0_.FailedPwdAttemptWndStart as FailedP21_1_, user0_.FailedPwdAnsAttemptCnt as FailedP22_1_, user0_.FailedPwdAnsAttemptWndStart as FailedP23_1_ from MembershipUser user0_ where (user0_.LoweredName=? )]".<br><br><i>Base Exception Message</i>: "ORA-00904: "USER0_"."Password": invalid identifier.

Here in the QUERY the password field has been taken in double quotes(") as user0_."Password"  which is wrong.It should be as user0_.Password.
I have tried to remove the "Password" field from the "User.hbm.xml" and "User.cs".But still the same problem arises.

Can any body please help me!
Thanks in advance....


 
Nov 11, 2008 at 12:38 PM
I believe the Password column has quotes in the mapping file because for some databases "Password" is a reserved word.  So the quotes need to stay.  The problem here is that Oracle interprets a double-quoted identifier as a case-sensitive identifier, but the column has been created as PASSWORD, so Password and PASSWORD do not match.

Modify the database create script like so...:
create table MEMBERSHIPUSER (
    ID NUMBER(38,0) not null,
    NAME VARCHAR2(255) not null,
    LOWEREDNAME VARCHAR2(255) not null,
    DESCRIPTION VARCHAR2(255) null,
    "Password" VARCHAR2(128) not null,
...
Now the column names should match.
Nov 12, 2008 at 4:06 AM

Thanks a lot! thank you very much.
Yes,Password is a reserved word for Oracle.I just renamed(alter table membershipuser rename column Password to "Password") the Password column within a quote as "Password".And everything is running fine.Thank you again.