Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Dec 17, 2017 1:04 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Database.Connect() causes partial paint of Window (startup)
PostPosted: Sat May 11, 2013 7:48 am 
Offline

Joined: Tue Apr 09, 2013 12:45 am
Posts: 7
Location: UK
Does anyone have any guidance on where a Database.Connect() method should be called on application startup...as we are experiencing partial window drawing if there are connection issues - which is not particularly intuitive for users.

We have tried in Window.Open(), Window.Activate() [with a appStarting Boolean guard to stop it firing each time the window becomes frontmost]

However, in either of these instances the Window does not get fully drawn; and the application hangs particularly if the database connection is not available.

Should we be connecting to the database in a separate thread? Or is the effect just a side effect of using the debugger?

Any thoughts welcome!

Tested on:
MSSQL and MySQL databases, Windows Vista/Windows 7


Top
 Profile  
Reply with quote  
 Post subject: Re: Database.Connect() causes partial paint of Window (start
PostPosted: Sat May 11, 2013 8:57 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
If you are going for a persistent connections (one that is live for the duration of the application)

I personally put the Connect in APP.OPEN

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Database.Connect() causes partial paint of Window (start
PostPosted: Sat May 11, 2013 10:44 am 
Offline

Joined: Tue Apr 09, 2013 12:45 am
Posts: 7
Location: UK
App.Open is a possible, though is the Database.Connect still a blocking call (i.e you have to wait to timeout before any other Window can be shown/repainted etc or any control e.g. a progress wheel is shown)? [We have tried Database.Multithreading=True but this is also blocking (in the debugger)]

It would be useful to know if there was any event firing/dispatch flowchart for starting and running Applications....has anybody ever published a "cheat sheet".

Perhaps we need to have a splash screen with a separate timer thread that spawns the persistent database connection (in the App) after a specified period of time.


Top
 Profile  
Reply with quote  
 Post subject: Re: Database.Connect() causes partial paint of Window (start
PostPosted: Sat May 11, 2013 10:52 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
so in App.Open

SplashScreen.Show
connect to db
SplashScreen.Close
if db failed then
show msg
quit
end if


And no there is no cheat sheet.... the actual order of events is not as fixed as you might imagine... depends on your code, which OS etc.



Or for that matter... define the DB as a global property... but have the connection itself made INSIDE the splash screen.... that way the Splash is a self-contained object, and will close when the DB connect succeeds or fails.....

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Database.Connect() causes partial paint of Window (start
PostPosted: Sat May 11, 2013 11:19 am 
Offline

Joined: Tue Apr 09, 2013 12:45 am
Posts: 7
Location: UK
Thanks for looking at this. We have tried App.Open, but are still experiencing an issue with painting of the windows:

i.e. the SplashScreen window appears, but the labels do not; and only appear AFTER the db.Connect() times out?

Does anybody know if this is a feature of the MySQL/MSSQL library?
Or the debugger?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group