1) Login to Our System(Browser). 2) From session bean we update one table,while updating that table one trigger is fired. 3)In trigger we update another table along with User-Name(Client name/Browser).In trigger we write following syntax to getting User Name
select sys_context('USERENV','TERMINAL') from dual;
but we are getting User name as null .
While debugging through pl/sql dev or executing that query we are getting USERNAME from which we logged to oracle.
That is because the JDBC connection is not setting up this when it is connecting. Besides the client machine/browser is not connecting to the database - the app server is (where SessionBean is running) more over it is probably using a Connection Pool so all users are running under the same username/password to the database.
Most likely you need to capture the username they logged into the application with and send that along with the insert to capture the user actually making the change.