openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter (JIRA)" <>
Subject [jira] Commented: (OPENJPA-952) Utilize Sun JDK's Attach API to dynamically load the OpenJPA enhancer agent
Date Tue, 03 Mar 2009 21:40:56 GMT


Kevin Sutter commented on OPENJPA-952:

This sounds very promising!  Thanks for diving into this.  A couple of questions...

Can you comment on or further explain your third caveat above?  So, you are indicating that
the "earliest OpenJPA code" is when an EM is created?  Why not any earlier?  For example,
when creating the EMF?  We still may hit the window you are describing, but it might be a
little narrower.

And, in the case of an Entity class loaded by the JVM before the agent is hooked up...  You
mention that the enhancement won't take place.  Okay.  But, what happens then?  Would we fall
back into the subclassing support?

Or, could we detect this condition and possibly do the class redefinition to replace the class
that was already loaded?


> 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
> 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