openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] Updated: (OPENJPA-952) Utilize Sun JDK's Attach API to dynamically load the OpenJPA enhancer agent
Date Wed, 20 May 2009 13:50:45 GMT


Rick Curtis updated OPENJPA-952:

    Attachment: OPENJPA-952.patch

Giving this one another shot. 

* Refactored much of the code (as Miloz commented, there was some commonality between what
I was doing and the InstrumentationFactory).
* Previously I mentioned that the code needed to be compiled with JDK1.5, that is no longer
* The previous patch didn't have the test suite that I added.
* To run the entire test suite:
	openjpa-parent>mvn test -P test-dynamic-enhancer,test-derby -DfailIfNoTests=false
* The test suite is composed of:
	- All tests that failed when running with subclassing.
	- All tests in the following openjpa-persistence-jdbc packages
		- org.apache.openjpa.persistence.enhance
		- org.apache.openjpa.persistence.relations
		- org.apache.openjpa.persistence.simple
		- org.apache.openjpa.persistence.identity
		- org.apache.openjpa.persistence.annotations

* To run a single test with the dynamic enhancer:
	openjpa-parent>mvn test -P test-dynamic-enhancer,test-derby -DfailIfNoTests=false -DdynamicTest=org.apache.openjpa...

> Utilize Sun JDK's Attach API to dynamically load the OpenJPA enhancer agent
> ---------------------------------------------------------------------------
>                 Key: OPENJPA-952
>                 URL:
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 2.0.0
>         Environment: Sun 1.6 JDK. 
> Note: The Attach API is ONLY a part of the JDK, not the SDK.
>            Reporter: Rick Curtis
>            Assignee: Michael Dick
>         Attachments: OPENJPA-952.patch, OPENJPA-952.patch, OPENJPA-952.patch
>   Original Estimate: 0h
>  Remaining Estimate: 0h
> When running in a JSE environment, OpenJPA could use the Attach API to dynamically load
the enhancer agent at runtime. Dynamically loading the enhancer means that an OpenJPA developer
doesn't need to configure a -javaagent. Doing this would dramatically improve the out of box
performance, and also improve the ease of use. 
> This improvement has the following caveats:
> 1.) This API is ONLY a part of the 1.6 JDK.
> 2.) This API is supported by only the Sun JDK.
> 3.) If the agent is loaded from the earliest OpenJPA code, the agent will be laoded when
creating an EntityManager in the EntityManagerFactoryImpl. If an Entity class is loaded by
the JVM before the enhancer agent is loaded, that class' byte code will not be enhanced. 
> Attach API -

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message