Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Auditing for Oracle with EclipseLink JPA(oracle with eclipselink auditing issues)
icon5.gif  Auditing for Oracle with EclipseLink JPA [message #539429] Thu, 10 June 2010 17:07 Go to next message
enrique  is currently offline enrique Friend
Messages: 4
Registered: May 2010
Junior Member
Hello everybody i am using EclipseLink and i have to audit in oracle so i can audit using pure JDBC with the V$session and i can audit the application name in oracle in this way but here in EclipseLink JPA i cannot set the application name to be audited, the way in which i have been trying is by setting dinamically the session param i want using the SessionCustomizer but it does not do what is supposed to do..... no error is shown but does not audit the name in oracle.... i have time struggling with this and no result, the code i am using is:

the customizer class is:

package com.util;

import org.eclipse.persistence.config.SessionCustomizer;
import org.eclipse.persistence.sessions.Session;

* @author xkalibur
public class ProgramCustomizer implements SessionCustomizer{
public void customize(Session s) throws Exception {
//s.getDatasourceLogin().setProperty("v$session.program","Employees ");----------- tried with this method
//s.getLogin().setProperty("v$session.program","Employees "); ----------------------- tried with this one as well

by using one of the commented lines above which are supposed to work, did not work...

also tried changing those lines instead these ones:

DatabaseLogin login= (DatabaseLogin) s.getDatasourceLogin();

did not work too.

i was reading the eclipse link and it is done in this way ...

the method to edit is:

public void edit(Employee employee) {

emProperties.put(PersistenceUnitProperties.SESSION_CUSTOMIZE R, "com.util.ProgramCustomizer");
factory = Persistence.createEntityManagerFactory("EJBLocalPU", emProperties);
em = factory.createEntityManager();


it performs the merge very well but does not audit the application name i want into the database.

Do you have any idea on how to solve this issue...

thanks in advance.-
Re: Auditing for Oracle with EclipseLink JPA [message #539994 is a reply to message #539429] Mon, 14 June 2010 14:24 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

See, clipseLink-JPA

James : Wiki : Book : Blog : Twitter
Previous Topic:potential memory leak persisting objects with eclipselink 2
Next Topic:PluralAttribute.getJavaType returns element type instead of collection type
Goto Forum:

Current Time: Sun Jun 24 17:11:57 GMT 2018

Powered by FUDForum. Page generated in 0.02271 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top