I talk about hibernate because of the model, not hibernate. My problem was the use of userName as the foreign key in role table : my (generated standard) model is made with 3 tables and ids as foreign keys, which is not compatible with DataSourceRealm 2 tables model.
mgainty wrote: > > possible OpenSessionInViewFilter problem > which version hibernate are you implementing with? > > M-- > ----- Original Message ----- > From: "jmuller" <[EMAIL PROTECTED]> > To: <users@tomcat.apache.org> > Sent: Friday, September 21, 2007 9:14 AM > Subject: Re: Authentication and authorization questions > > >> >> >> Christopher Schultz-2 wrote: >> > >> > -----BEGIN PGP SIGNED MESSAGE----- >> > ... >> >> How can you use JDBCRealm or DataSourceRealm with [numeric] foreign > keys >> >> from roles >> >> table to user table, rather than requiring the roles table to >> duplicate >> >> whatever field (e.g. username, email address) will actually be entered >> >> into >> >> the login screen? >> > >> > You can't. You'd have to write your own Realm implementation. >> > >> >> I ask because using simple text-matching rather than using >> >> the primary key of the user table seems a bit inefficient >> > >> > Are you sure about that? You might want to do a performance test on >> your >> > database. You're likely to find that string matching is /very/ fast, >> > especially if you have the columns indexed (and you really should). >> > >> >> but more >> >> importantly it may be disallowed from data standards in some >> >> organizations. >> > ... >> > >> >> Hello, >> I've got the same problem of a foreign key with 3 tables (generated by >> hibernate) for user and roles: >> - one UserTable with id, name and password, >> - one RoleTable with id and name >> - one RelationTable with userId and roleId >> >> I've written my own DataSourceRealm that overwrite Tomcat's one, and put > the >> jar in server/lib. >> It only overwrites the getRoles() method to change the SQL statement. See >> source here: http://www.nabble.com/file/p12820411/DataSourceRealm.java >> DataSourceRealm.java (free to use/modify/comment) ! >> -- >> View this message in context: > http://www.nabble.com/Authentication-and-authorization-questions-tf4345698.h > tml#a12820411 >> Sent from the Tomcat - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Authentication-and-authorization-questions-tf4345698.html#a12824172 Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]