Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Re: rcp, osgi, and dynamic weaving

When using JPA in a Java EE container this behavior IS on by default.

The issue for other scenarios is we need a hook into the classloader to make this work since we are actually modifying classes as they are loaded.

In Java SE you can enable this by using our javaagent to run some code before the main method using the -javaagent switch. (i.e. all you do is provide the flag: -javaagent:eclipselink.jar)

In OSGi, as you know, classloaders are a little more complicated. In order to get a hook into the classloader we actually need to get it from the OSGi implementation itself. Equinox provides some non-standard behavior that allows this. We leverage that behavior to allow weaving at runtime - that is what is described in this thread.

In scenarios not listed above, static weaving can be used. With static weaving, you run a tool on your classes prior to deploying them and they are weaved in-place.

For more information about weaving, take a look at the web site for the tool we are using, ASM. They have some pretty good tutorials and articles.


Chiovari Cristian Sergiu wrote:
Thx for your information.

Despite my next question may look dummy i ask you why this enhanced performatice option is not set as default to eclipse link ?

There are some drawbacks on this ?

--- On Wed, 1/7/09, Tom Ware <tom.ware@xxxxxxxxxx> wrote:

From: Tom Ware <tom.ware@xxxxxxxxxx>
Subject: Re: [eclipselink-users] Re: rcp, osgi, and dynamic weaving
To: "EclipseLink User Discussions" <eclipselink-users@xxxxxxxxxxx>
Date: Wednesday, January 7, 2009, 4:26 PM
Why not?  The classes are weaved when they are loaded.  As
far as the java VM is concerned the classes are the same for
the life of the app.


Philipp Kursawe wrote:
On Wed, 07 Jan 2009 14:36:52 +0100, Tom Ware
<tom.ware@xxxxxxxxxx> wrote:
Dynamic weaving is used for several performance
enhancing features in EclipseLink. (e.g. lazy loading of
ToOne relationships, fetch groups, optimized change
tracking, optimized cache lookups)
When enabled, it provides all these features
transparently and hence boosts the performance of your
Unfortunatly it also changes the identity of objects.
You cannot do a instanceof anymore with weave'd objects.
eclipselink-users mailing list
eclipselink-users mailing list

eclipselink-users mailing list

Back to the top