New topic: 

Open database in app or session?

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

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        Farflame          Post subject: Open database in app or 
session?Posted: Thu Sep 06, 2012 12:09 pm                         
Joined: Tue Oct 05, 2010 6:25 am
Posts: 181                I know the usual advice is to open the database in 
each session.open, because if I open it in app and then the app copy is closed, 
that would close it in every session too. But I'm writing a game where I want 
the app to stay active all the time to process the game logic. I have autoquit 
set to false. So is there any reason in this situation for each session to have 
it's own seperate access to the database? Couldn't the sessions just make their 
calls to the app instance of the database?

Is there a performance issue here or is it entirely due to the problem with 
closing the database. If the latter, is there a problem with keeping the 
database open at all times? Should I close it when I've stopped working with 
it, and then reopen it again later (in which case each session would clearly 
need it's own access)?   
                             Top                npalardy          Post subject: 
Re: Open database in app or session?Posted: Thu Sep 06, 2012 1:32 pm            
           Real Software Engineer          
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7408
Location: Canada, Alberta, Near Red Deer                Farflame wrote:I know 
the usual advice is to open the database in each session.open, because if I 
open it in app and then the app copy is closed, that would close it in every 
session too. But I'm writing a game where I want the app to stay active all the 
time to process the game logic. I have autoquit set to false. So is there any 
reason in this situation for each session to have it's own seperate access to 
the database? Couldn't the sessions just make their calls to the app instance 
of the database?

Is there a performance issue here or is it entirely due to the problem with 
closing the database. If the latter, is there a problem with keeping the 
database open at all times? Should I close it when I've stopped working with 
it, and then reopen it again later (in which case each session would clearly 
need it's own access)?

you're asking for many threads (sessions) to effectively share on connection to 
the database which is a recipe for bad things to happen      
_________________
My web site Great White Software
RBLibrary.com REALbasic learning  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 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

rbforumnotifier@monkeybreadsoftware.de

Reply via email to