Set Oracle CLIENT_IDENTIFIER for Liferay portlet db transaction


Custom portlet accessing external Oracle 12c db (i.,e, not liferay db)


Want to set Oracle CLIENT_IDENTIFIER so Oracle Trigger can add application username to audit column.

Like this...

DBMS_SESSION : Managing Sessions From a Connection Pool in Oracle Databases

End-To-End Tracing From Java

[url removed, login to view]

End-To-End Tracing From Java

Java programs connecting to the database using JDBC can set the MODULE, ACTION and CLIENT_IDENTIFIER columns of the V$SESSION view without calls to the DBMS_APPLICATION_INFO or DBMS_SESSION packages. This makes it a more scalable solution, since extra calls to the database are not required.

When a new connection (conn) is made, or a connection is pulled from the connection pool, the details are set using the following type of code.

try {

String e2eMetrics[] = new String[OracleConnection.END_TO_END_STATE_INDEX_MAX];

e2eMetrics[OracleConnection.END_TO_END_ACTION_INDEX] = "Starting";

e2eMetrics[OracleConnection.END_TO_END_MODULE_INDEX] = "MyProgram";

e2eMetrics[OracleConnection.END_TO_END_CLIENTID_INDEX] = "tim_hall";

((OracleConnection) conn).setEndToEndMetrics(e2eMetrics, (short) 0);

} catch (SQLException sqle) {

// Do something...


Before releasing a connection back to the connection pool, the details should be blanked.

try {

String e2eMetrics[] = new String[OracleConnection.END_TO_END_STATE_INDEX_MAX];

e2eMetrics[OracleConnection.END_TO_END_ACTION_INDEX] = null;

e2eMetrics[OracleConnection.END_TO_END_MODULE_INDEX] = null;

e2eMetrics[OracleConnection.END_TO_END_CLIENTID_INDEX] = null;

((OracleConnection) conn).setEndToEndMetrics(e2eMetrics, Short.MIN_VALUE);

} catch (SQLException sqle) {

// Do something...


Færdigheder: Oracle, Software Arkitektur, Software Udvikling

Se mere: oracle query set mlm upline, access portlet object jsp liferay, jsr 168 portlet development using liferay, symbian java oracle client, javascript oracle client, lancer oracle client java linux, portlet web services liferay, liferay tomcat oracle, j2ee oracle client version available, vb6 oracle client tools 2000 server, deploy vbnet project without installing oracle client, use activex crystal reports oracle client, best portlet add contacts liferay, use oracle client net, oracle client net

Om arbejdsgiveren:
( 0 bedømmelser ) Canada

Projekt-ID: #14312974

1 freelancer byder i gennemsnit $588 for dette job


Looking forward to discuss further details about the project and deliver the same to your specifications and needs .

$588 CAD in 10 dage
(77 bedømmelser)