Closing Databases

Discuss OrbForms Designer and PocketC Architect

Postby rogernc on Thu Apr 17, 2003 11:26 am

Hi. While looking at the code for the Survey example that comes with OrbForms, I noticed that the database is closed after anything is done to it. Like in ReadRecord and WriteRecords functions.

The only thing I'm wondering is if it was good practice to do this? Is it bad to keep the databases open all the time while in your app? I'm only trying to understand the reasoning so I can choose a way to do it in my own apps.

Would opening and closing it every time slow it down?
Thanks in advance.

Posts: 10
Joined: Thu Apr 17, 2003 10:56 am

Postby FrankG on Thu Apr 17, 2003 3:09 pm


I tend to leave DBs open and only close them when I know I'm finished with them. I don't know if that's a good practice or not. Perhaps I should consult's developer section; I think they have a document with recommendations for things like that(?).

Anyway, even without closing the database, a good thing about how they're implementated [in OrbForms? in the PalmOS?] is that once the record is closed, it is in the database. So even if the program blows up, the record isn't lost. Consequently, I haven't found a reason to close the DBs as I write records.

Posts: 210
Joined: Thu Jan 23, 2003 7:58 pm

Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests