New topic: 

Database.Connect() causes partial paint of Window (startup)

<http://forums.realsoftware.com/viewtopic.php?t=47849>

         Page 1 of 1
   [ 5 posts ]                 Previous topic | Next topic          Author  
Message        contentengineer          Post subject: Database.Connect() causes 
partial paint of Window (startup)Posted: Sat May 11, 2013 7:48 am               
          
Joined: Tue Apr 09, 2013 12:45 am
Posts: 6
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                DaveS          Post subject: 
Re: Database.Connect() causes partial paint of Window (startPosted: Sat May 11, 
2013 8:57 am                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4863
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                contentengineer          Post 
subject: Re: Database.Connect() causes partial paint of Window (startPosted: 
Sat May 11, 2013 10:44 am                         
Joined: Tue Apr 09, 2013 12:45 am
Posts: 6
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                DaveS          Post subject: 
Re: Database.Connect() causes partial paint of Window (startPosted: Sat May 11, 
2013 10:52 am                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4863
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                contentengineer          Post 
subject: Re: Database.Connect() causes partial paint of Window (startPosted: 
Sat May 11, 2013 11:19 am                         
Joined: Tue Apr 09, 2013 12:45 am
Posts: 6
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             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 5 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to