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
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();
login.setProperty("v$session.program","Clients");


did not work too.

i was reading the eclipse link http://wiki.eclipse.org/Configuring_a_Session_(ELUG) 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();
em.merge(employee);

}


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 Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

See,

http://www.coderanch.com/t/498795/ORM/java/Auditing-Oracle-E 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: Tue Sep 23 14:39:59 GMT 2014

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

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