Author: akazakov
Date: 2008-10-30 14:47:57 -0400 (Thu, 30 Oct 2008)
New Revision: 11364
Modified:
branches/jbosstools-3.0.0.Beta1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java
Log:
https://jira.jboss.org/jira/browse/JBDS-461 We shouldn't create the driver a few
times. Fixed that.
Modified:
branches/jbosstools-3.0.0.Beta1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java 2008-10-30
18:45:43 UTC (rev 11363)
+++
branches/jbosstools-3.0.0.Beta1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java 2008-10-30
18:47:57 UTC (rev 11364)
@@ -312,13 +312,19 @@
return server;
}
+ private static boolean driverIsCreated = false;
+
/**
* Creates HSQL DB Driver
* @param jbossASLocation location of JBoss AS
* @throws ConnectionProfileException
* @return driver instance
*/
- private static DriverInstance createDriver(String jbossASLocation) throws
ConnectionProfileException {
+ private static void createDriver(String jbossASLocation) throws
ConnectionProfileException {
+ if(driverIsCreated) {
+ // Don't create the driver a few times
+ return;
+ }
DriverInstance driver =
DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
if (driver == null) {
TemplateDescriptor descr =
TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
@@ -362,6 +368,8 @@
ProfileManager.getInstance().createProfile("DefaultDS", "The JBoss AS
Hypersonic embedded database", IDBConnectionProfileConstants.CONNECTION_PROFILE_ID,
props, "", false);
}
- return driver;
+ if(driver!=null) {
+ driverIsCreated = true;
+ }
}
}
\ No newline at end of file