This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 83322 - JavaDB should only be started if needed
Summary: JavaDB should only be started if needed
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Nitya Doraisamy
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2006-08-23 22:58 UTC by Pavel Buzek
Modified: 2008-03-02 19:55 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2006-08-23 22:58:52 UTC
The sun app server plugin starts Java DB when started from NB. This is taking
resources that may not be needed if the application does not use database.

OTOH, the DB is not started when deploying to tomcat.

It should be possible to detect if a j2ee module uses the Java DB that is
registered with NetBeans and start it then - similarly as we start the DB when
the user wants to connect, e.g. in entity from DB wizard.

I did not look into details, the solution may be partly in sun plugin an partly
in j2eeserver and db.
Comment 1 Sherold Dev 2006-08-24 11:12:09 UTC
Should this really be tracked as a defect. It seems more like an enhancement to me.
Comment 2 _ ludo 2006-08-24 18:44:50 UTC
Same for me. This is optimization.
I think this side effect is in any case better than if we did not start the DB.
In this case, they are really hard to understand errors in the server lgo file.
Net CAT filed a P2 for that, and this is why we start the DB now.
Comment 3 Pavel Buzek 2006-08-24 19:06:50 UTC
I filed this as a defect for 2 reasons:

First, this is a performance issue. Unless you have tons of memory an additional
20 megs or so every time you start glassfish is noticable.

Second, I was hoping that if we come with a better mechanism to start DB only
when needed we could also make it work for tomcat or jboss. Because the same
issue - which you say is a P2 defect - applies to these servers.

I won't set it back to defect now, but please comment. Tx.
Comment 4 _ ludo 2006-08-24 19:44:40 UTC
My comment is that we are way past the date where we can even discuss behaviour
for current 5.5 product.

Now, if we have time to 'find a way for a better mechanism to start DB only
when needed' (I guess in J2EE projects), then implement it, then add it to the
5.5 feature list so that we can approve it, I am fine with this :-)
Of course, this needs to be locked at for 6.0, don't get me wrong there.
Comment 5 hlavki 2006-09-04 15:50:46 UTC
for me it's defect too... I realy don't need to start derby with glassfish for 
one reason...
I have already started external derby database on 1527 port... 
Comment 6 Petr Jiricka 2006-09-04 17:20:27 UTC
If we can't easily determine whether starting Derby is "needed", could we at
least add a checkbox that will allow the user to disable the automatic start?
Keep the user in control...
Comment 7 _ ludo 2006-09-04 17:22:48 UTC
yes...Could do that, when we can change the ui. Can we now?
Comment 8 Petr Jiricka 2006-09-04 17:34:41 UTC
Yes, if we follow the Late UI changes process (notify the Tutorial team).
Comment 9 Vince Kraemer 2008-01-31 18:17:40 UTC
Most of the work for this is at the j2eeserver API level...  The project needs to be able tell something (likely the DB
modules or a serverplugin), "hey, start this DB since we have an app that is about to use it".

Pushing to the j2eeserver component to get the ball rolling again.
Comment 10 Petr Jiricka 2008-02-01 08:01:05 UTC
This is in fact a performance bug, not an enhancement request.
Comment 11 Petr Hejl 2008-02-01 10:30:41 UTC
According to desc3 and desc7 I would go with solution described in desc7 rather than designing some complicated api for
db start (not even sure if it should go through j2eeserver).
Comment 12 Nitya Doraisamy 2008-02-29 06:42:50 UTC
This seems to have come back to the plugin with the suggested fix (I think) of adding a checkbox that will allow the
user to disable the automatic start.

That should be simple and can be done for this release
Comment 13 Nitya Doraisamy 2008-03-02 19:55:29 UTC
Fixed. Added checkbox to Options tab of server propeties to enable/disable automatic start of Java DB with server
http://hg.netbeans.org/main/rev/f1bb27d9898e