Situation: I have simulated the loss of connection by simply doing a shutdown of the server. However, when closing the connection in my app before connecting to another database also makes the app crash. The crash is so hard that I don't even get a crash log.
I would like to get an opinion if there is something obviously stupid with the code I'm using for connecting. I have omitted the obvious stuff like setting the parameters for database, server etc and any error handling.
if theDatabaseConnection <> Nil and theDatabaseConnection.IsConnected then OpenDBServer
if theDatabase <> nil then
if theDatabase.IsOpen then theDatabase.Close()
theDBFolderitem = nil
theDatabase = nil
if isClientServer then
if theDatabaseConnection <> nil and theDatabaseConnection.IsConnected then
theDatabaseConnection = Nil
theServer = Nil
dim ConnectionThread as new getConnectionThread(Host, Login, ServerPassword, Port, conserv, MaxUsers)
dim Timeout as Integer = Ticks + 30 * 60
While not ConnectionThread.ConnectionIsOpen
if Ticks > Timeout then
'got some problems
if ConnectionThread.ProblemsOccurred then
'everything went fine
theDatabaseConnection = ConnectionThread.getConnection
theServer = new VServer(theDatabaseConnection)
theDatabaseConnection = new VConnection(Host, Login, ServerPassword, Port, 30, conserv)
Because this code crashes so hard I don't have a good idea what might go wrong here.
Mit freundlichen Grüßen/Regards
Mail Archiver X: The email archiving solution for professionals