Hi Rob, I’ve done exactly as you say, in a squeaky clean installation of Servoy 3.1b3 (and also 3.0.2) using a second solution to import one of the stock standard demo solutions that ship with Servoy. After importing with a script, application.closeSolution() doesn’t work. File>Close doesn’t work. Open Repository doesn’t give a warning that there’s a solution open and doesn’t load any solution the first time after the import. It does load on the second attempt.
I don’t think the delay (when exiting Servoy and restarting) is being caused by Sybase loading, I see that load quite early, and I’ve NEVER seen Servoy take 5-10 minutes to load a solution under any other circumstances.
I posted two example solutions with my support request 60206. Could you try importing at your end and see if it works as you’ve described. Perhaps my method is not right?
var SolutionRelease = application.getSolutionRelease();
var SolutionName = application.getSolutionName()
var L_Poster, L_HttpResult, L_HttpCode, L_TmpFile,L_TmpSiNo, L_AddParam ;
L_TmpFile = plugins.file.convertStringToJSFile('C:/Program Files/Servoy3.1b3/solutions/_START_HERE3.servoy');
L_TmpSiNo = L_TmpFile.exists();
if ( L_TmpSiNo == true )
{
//Import file...
L_Poster = plugins.http.getPoster('http://localhost:8080/servoy-admin/solutions/import');
L_AddParam = L_Poster.addFile('if','file',L_TmpFile);
L_AddParam = L_Poster.addParameter('submit','Import!');
//General options...
L_AddParam = L_Poster.addParameter('ac','1'); // 1 = Activate new release of imported solution and modules
L_AddParam = L_Poster.addParameter('os','1'); // 1 = Overwrite repository styles with import version
L_AddParam = L_Poster.addParameter('om','1'); // 1 = Overwrite repository media with import version
L_AddParam = L_Poster.addParameter('og','1'); // 1 = Overwrite repository group security settings with import version
L_AddParam = L_Poster.addParameter('fs','1'); // 1 = Override auto enter types to the auto enter types contained in the import version.
//WARNING: This may break other solutions using the same tables, or cause tables to use nonexistent dbidentity or dbsequence sequences or other database auto enter types!
L_AddParam = L_Poster.addParameter('ak','0'); // 1 = Allow reserved SQL keywords as table or column names (will fail unless supported by the backend database)
L_AddParam = L_Poster.addParameter('sd','0'); // 1 = Import solution sample data
L_AddParam = L_Poster.addParameter('id','0'); // 1 = Import internationalization
L_AddParam = L_Poster.addParameter('io','0'); // 1 = Insert new internationalization (i18n) keys only
//User import options...
L_AddParam = L_Poster.addParameter('up','1');
// 0 = Do not import users contained in import
// 1 = Create nonexisting users and add existing users to groups specified in import
// 2 = Overwrite existing users completely (USE WITH CARE)
L_AddParam = L_Poster.addParameter('aa','1'); // 1 = Allow users to be added to the Administrators group
// Merging options - if merging
// L_AddParam = L_Poster.addParameter('ms','0'); // Merge solution if revision information is available, and when a merge conflict arises use:
// L_AddParam = L_Poster.addParameter('ul','0'); // 0 = repository version; 1 = import version
// or Merging options - if not merging
L_AddParam = L_Poster.addParameter('ms','1'); // Do not merge solution, and:
L_AddParam = L_Poster.addParameter('of','1'); // overwrite repository forms with import version
L_AddParam = L_Poster.addParameter('df','1'); // delete repository forms which do not exist in import version
// DO POST
L_HttpCode = L_Poster.doPost('xxxxxx', 'xxxxxxx');
globals.gHTTP = L_HttpCode
application.updateUI()
if (L_HttpCode == 200 )
{
plugins.dialogs.showInfoDialog( "Success!", "Update successfully completed.\n Restart required. Click OK to exit", "OK")
// application.exit()
application.closeSolution( )
//Close the current open solution
}
else
{
// an error occurred, error handling here
plugins.dialogs.showErrorDialog( "ERROR", "Import failed", "OK")
}
}