Wednesday, August 13, 2008

Bugfix for Spring Extension Factory available

I fixed a problem that prevents the Spring Extension Factory (which I originally described in this post) to work for bundles with Eclipse-LazyStart set to true. The new version works for bundles with or without the layz start setting:
Thanks for reporting the problem as well as a solution, Jimmy!

7 comments:

mattre said...

Hi Martin!
Thanks for your helpful plug-in!
But I have one problem with it: My Eclipse RCP application uses Hibernate for persistence which takes about 5-8 secs to start up (I have a bigger model). The UI bundle references the hibernate service and therefore the UI bundle has to wait until the hibernate bundle is completly started.

You have set a timeout of 5 seconds to wait for the application context. For me this is not sufficient...
Why have you set 5 seconds and not waiting until the application context is really available?!?

Martin Lippert said...

Hi Matthias!

I have to admit that the value for the timeout is absolute randomly chosen. If you need more than 5 sec, I (or you yourself) could change it to a more suitable value for you, no problem at all.

But in the end you need a timeout for the operation since you don't want to block your app forever when the application context will not appear (for what reason ever). If you have a safe setting for which you know everything will be all right you could set the timeout to a very large value. This would allow your app to work correctly even if your hibernate setting needs more than 8sec to come up.

Should I make the timeout value configurable for the next version of the spring extension factory? Maybe this would be the easiest way for people to parametrize this. What do you think?

Thanks for your feedback!!!

Cheers,
-Martin

mattre said...

Hi Martin!

Thank you for your positive response!
Ok, I understand that you have to set a timeout... but I think that I am not the only person with such an environment.
Of course I could change the plug-in localily but I think it would be cool that you make the timeout value configurable... because it would be such a great pity, when someone won't use Eclipse RCP in conjunction with Spring DM because the application terminates with a (meaningless) NullPointerException, not knowing that the timeout of the application context service has exceeded.

Keep up the good work,
Matthias

Martin Lippert said...

Hi Matthias!

You are absolutely right and I will make the concrete timeout value configurable for the next version of the spring extension factory. I think a system property value should be fine, ok?

Thanks again for the feedback!

Cheers,
-Martin

Martin Lippert said...

I posted a new version of the spring extension factory a moment ago. It allows you to set the timeout via a system property. Hope this helps!

Cheers,
-Martin

mattre said...

Martin,

thank you for the update! I have already noticed the new version on planet eclipse!
Thank you!

Matthias

Martin Lippert said...

:-)