Implementing modified by in EJB

Discussions

EJB design: Implementing modified by in EJB

  1. Implementing modified by in EJB (1 messages)

    Hi...
    I think no one has ever brough this up about implementing the modified_by field when updating an EJB but it's bothering me for so long. So please comment on our implementation. I want to know how other people implemented it. Here's how we do it.

    1. update a bean
    2. username = context.getCallerPrincipal().getName()
    3. user = UserHome.findByUserName(username)
    4. id = user.getID()
    5. modifiedBean.setModifiedBy(id)

    What do you think? I feel that it's a bit inefficient cause retrieving the userEJB would synchronize all fields from the database, where I don't need the other fields. We implemented it this way cause I feel that it is more OO. If we directly use sql to retrieve the id, accessing the user ejb wouldn't be consistent. What's your opinion?

    thanks...

    Jerson

  2. Implementing modified by in EJB[ Go to top ]

    EJB gurus...
    Please comment. I need your opinion.

    Thanks.

    Jerson