* Improve startup time
* Make validation of application server and database connection on startup optional * Separate the database interface file by database. This will ease concurrent development of multiple database support.
This commit is contained in:
parent
8ede88a395
commit
a12fa4bcab
|
@ -302,7 +302,10 @@ public final class ALogin extends CDialog
|
||||||
{
|
{
|
||||||
m_cc = CConnection.get(Adempiere.getCodeBaseHost());
|
m_cc = CConnection.get(Adempiere.getCodeBaseHost());
|
||||||
hostField.setValue(m_cc);
|
hostField.setValue(m_cc);
|
||||||
validateConnection ();
|
|
||||||
|
if ( Ini.isPropertyBool(Ini.P_VALIDATE_CONNECTION_ON_STARTUP)) {
|
||||||
|
validateConnection();
|
||||||
|
}
|
||||||
|
|
||||||
// Application/PWD
|
// Application/PWD
|
||||||
userTextField.setText(Ini.getProperty(Ini.P_UID));
|
userTextField.setText(Ini.getProperty(Ini.P_UID));
|
||||||
|
@ -339,15 +342,25 @@ public final class ALogin extends CDialog
|
||||||
}
|
}
|
||||||
} // processWindowEvent
|
} // processWindowEvent
|
||||||
|
|
||||||
|
private void validateAppServer() {
|
||||||
|
m_cc.testAppsServer();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void connectToDatabase() {
|
||||||
|
//Check connection
|
||||||
|
DB.setDBTarget(m_cc);
|
||||||
|
DB.connect();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate Connection
|
* Validate Connection
|
||||||
*/
|
*/
|
||||||
private void validateConnection()
|
private void validateConnection()
|
||||||
{
|
{
|
||||||
m_connectionOK = false;
|
m_connectionOK = false;
|
||||||
//
|
validateAppServer();
|
||||||
m_cc.testAppsServer();
|
|
||||||
m_cc.testDatabase(false);
|
connectToDatabase();
|
||||||
//
|
//
|
||||||
hostField.setDisplay();
|
hostField.setDisplay();
|
||||||
} // validateConnection
|
} // validateConnection
|
||||||
|
@ -393,6 +406,7 @@ public final class ALogin extends CDialog
|
||||||
connectionOK(); // first ok
|
connectionOK(); // first ok
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
m_okPressed = true;
|
m_okPressed = true;
|
||||||
defaultsOK(); // disposes
|
defaultsOK(); // disposes
|
||||||
}
|
}
|
||||||
|
@ -532,7 +546,7 @@ public final class ALogin extends CDialog
|
||||||
m_pwd = new String (passwordField.getPassword());
|
m_pwd = new String (passwordField.getPassword());
|
||||||
|
|
||||||
// Establish connection
|
// Establish connection
|
||||||
DB.setDBTarget(CConnection.get());
|
connectToDatabase();
|
||||||
if (!DB.isConnected())
|
if (!DB.isConnected())
|
||||||
{
|
{
|
||||||
statusBar.setStatusLine(txt_NoDatabase, true);
|
statusBar.setStatusLine(txt_NoDatabase, true);
|
||||||
|
|
Loading…
Reference in New Issue