Hi all,
I'm having an issue using PROXYTYPE connections in my ADF (11.1.1.7) Application.
To explain the problem, I created two functional users that have "connect" privileges "through" the user that sets up the jdbc connection.
Grant connect through MY_JDBC_USER to MY_FUNC_USER_ONE;
Grant connect through MY_JDBC_USER to MY_FUNC_USER_TWO with roles ROLE_ONE;
If I connect MY_FUNC_USER_ONE, the connection is successful. The current user (line 09 below) is displayed as FUNC_USER_ONE. Unfortunately I get lots of ORA_0942 (table or view does not exist).
That is why I added the "with roles" option to MY_FUNC_USER_TWO.
However when I now try to connect MY_FUNC_USER_TWO using the openProxySession(), it does not work... The current user (line 09 below) is displayed as MY_JDBC_USER.
I do not get any errors from the database, so to be honest I don't have a clue why this is not working.....
Here is my code and note that I created my ownTranscationFactory that extends DatabaseTransactionFactory
.
public void prepareSession (Session session){
myTransactionImpl myTrans = (myTransactionImpl)this.getDBTransaction();
OracleConnection conn = hzpcTrans.getConnection();
String currentUser = ADFContext.getCurrent().getSecurityContext().getUserName();
java.util.Properties prop = new java.util.Properties();
prop.put(OracleConnection.PROXY_USER_NAME, currentUser);
try {
conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, prop);
DatabaseMetaData meta = conn.getMetaData();
System.out.println("the user currently on the session is " + meta.getUserName());
}
.catch.........
}
Any help is welcome.
Thanks