0 Replies Latest reply on Feb 13, 2014 5:14 PM by adamsn06

    How do I pass username from presentation layer to database?


      down vote  favorite  


      When a user saves or modifies an object, I want to persist their http session username in the database columns CREATE_USER and MODIFY_USER. I'm finding two difficulties with this:

      1) Our presentation layer and DAO layer are in separate WARs, so how to share the username ( besides directly passing with each call to the DAO layer) is not clear.

      2) How to pass the username from the DAO layer (we're using Hibernate) to the database efficiently isn't clear either. I've considered a Hibernate interceptor, but I'm not sure how to pass the entity manager to it.

      How do I solve these problems?