J2EE Security Design Question

R

Ryan Pape

I have a J2EE app where there is a one-one correspondence between the
JAAS user an an Entity bean (user EJB). As far as I know, there is no
way to automatically bind the two together so retrieveing the entity
bean associated with a user is done by something like,
UserHome.findByPrimaryKey(name_from_principal).

I have a stateful session bean, call it "Manager", that executes
actions to underlying entity beans for a particular user.

I have another entity bean, "file", which upon creation must be given
a reference to a third entity bean that can be dervied by looking at
the user entity bean I described above.

So my question is, from a design & performance perspective:

Is it better to, in ejbCreate methods for the file entity bean,
perform the lookup to get a user entity bean from the security
Principal each time

or

store a reference to the user entity bean in my stateful session bean
and pass it as a parameter to the create() method on my file entity
bean.

Any opinions would be appreciated.
 
B

Bryce (Work)

I have a J2EE app where there is a one-one correspondence between the
JAAS user an an Entity bean (user EJB). As far as I know, there is no
way to automatically bind the two together so retrieveing the entity
bean associated with a user is done by something like,
UserHome.findByPrimaryKey(name_from_principal).

What Application server are you using? JBoss has a Database Login
Module...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top