• Post Reply Bookmark Topic Watch Topic
  • New Topic

implementing modified_by in EJB  RSS feed

Jerson Chua
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. 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?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!