Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Eclipse Buddy Loading due to problems with Hibernate (Performance Question)
Eclipse Buddy Loading due to problems with Hibernate (Performance Question) [message #642110] Mon, 29 November 2010 21:17 Go to next message
No real name is currently offline No real nameFriend
Messages: 5
Registered: June 2010
Junior Member
Hello everybody,

I have a performance question according to buddy class loading. Following scenario: Bundle A contains Hibernate, Bundle B contains model classes which Hibernate must see. So I use Buddy Class Loading (policy: registered) and Hibernate can load the model classes. If there is another possibility than Buddy Class Loading then please let me know!!!

So to my question: How often registered plug-ins are searched for class definitions? Only one time when a class is first instantiated or every time a model class is instantiated.

Example: Class X is a model class and an object is created in Bundle A

for (int i = 0; i < 10; ++i) {
X x = new X();
}

In this case is the buddy class loading only used one time or ten times??

I hope someone can help me.

[Updated on: Tue, 30 November 2010 13:26]

Report message to a moderator

Re: Eclipse Buddy Loading due to problems with Hibernate (Performance Question) [message #642245 is a reply to message #642110] Tue, 30 November 2010 14:57 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
In this case Bundle A has a class loader which is the initiating class loader for class X. An initiating classloader will only be used once on the first time X is loaded. All other access to class X from classes loaded by Bundle A's class loader must not cause another class load request of class X.

Tom.
Re: Eclipse Buddy Loading due to problems with Hibernate (Performance Question) [message #642318 is a reply to message #642245] Tue, 30 November 2010 19:03 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 5
Registered: June 2010
Junior Member
Thomas, thanks for your reply.

Have you any source (literature, official document) for that? I've tried to find some but until know I did not have success.

Re: Eclipse Buddy Loading due to problems with Hibernate (Performance Question) [message #642322 is a reply to message #642318] Tue, 30 November 2010 19:15 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
This is not any different than the behavior of a normal class loader in java. The VM will not allow an initiating class loader to initiate a class lookup more than once after the class has been found by the initiating class loader. When I say initiate I mean initiated by the VM while dynamically running some code from a class. If you get your hands on the ClassLoader object it can of coarse be delegated to directly, the VM cannot prevent that.

But in your case you actually have the class X compiled into your class file and the class load of X is going to be initiated by the VM while running the code in your class.

HTH

Tom.
Previous Topic:Zombie Bundles
Next Topic:p2 update testing against alternative repo
Goto Forum:
  


Current Time: Wed Apr 24 16:48:44 GMT 2024

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

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

Back to the top