Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread DB often damaged / corrupted when PC loses power
Tue, Sep 4 2007 4:16 PMPermanent Link

Sam Jones
Greetings!

Overall, DBISAM v4.x (that we use) is GREAT. It really does just what we need. Our app
creates a local db, and in most cases every PC has its own, local db.

I have noticed, however, that the data files are often damaged when a user's PC loses
power or is 'reset' for any reason.

So, some questions:

Is there something I can do (property  to set) to make the db more stable in some way?

Is there a good way to automatically validate that the data files are in one piece (or to
detect if there was a dirty shutdown) ?


Other suggestions?

Thanks!
Tue, Sep 4 2007 5:05 PMPermanent Link

Dave Harrison
Sam Jones wrote:

> Greetings!
>
> Overall, DBISAM v4.x (that we use) is GREAT. It really does just what we need. Our app
> creates a local db, and in most cases every PC has its own, local db.
>
> I have noticed, however, that the data files are often damaged when a user's PC loses
> power or is 'reset' for any reason.
>
> So, some questions:
>
> Is there something I can do (property  to set) to make the db more stable in some way?
>
> Is there a good way to automatically validate that the data files are in one piece (or to
> detect if there was a dirty shutdown) ?
>
>
> Other suggestions?
>
> Thanks!
>

Sam,
   I assume you're using transactions for writing? After each commit,
you could execute a FlushBuffers to force the data to be written to disk
(or do it when the loop finishes). Of course getting a UPS and taping
the power switch will save you quite a few headaches too. Smile

Dave
Tue, Sep 4 2007 6:32 PMPermanent Link

"Adam H."
Hi Sam,

Which version of DBISam are you currently running? I had a similar issue
with earlier versions of 4, but the later versions seem to be more stable
when these things arise. Wouldn't hurt to make sure you're on the latest
version (or at least 4.24)

> Is there a good way to automatically validate that the data files are in
> one piece (or to
> detect if there was a dirty shutdown) ?

I normally write a key to the registry when the application starts, and
remove it when it closes. If the key is already there when starting the
application, I show a message letting the user know that the program shut
down unexpectedly, and that they should run a validation check.

HTH

Adam.

Wed, Sep 5 2007 6:57 AMPermanent Link

Chris Erdal
"Adam H." <ahairsub4@rREMOVEMEspamSTOPPER.jvxp.com> wrote in
news:F059E062-03D2-4F7A-AEB6-26D64676D7B5@news.elevatesoft.com:

>> Is there a good way to automatically validate that the data files are
>> in one piece (or to
>> detect if there was a dirty shutdown) ?
>
> I normally write a key to the registry when the application starts,
> and remove it when it closes. If the key is already there when
> starting the application, I show a message letting the user know that
> the program shut down unexpectedly, and that they should run a
> validation check.

neat!
--
Chris
(XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3)

Wed, Sep 5 2007 7:48 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


I can see that working well for single user systems but how does it work for multi-user ones?

Roy Lambert
Wed, Sep 5 2007 2:39 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I can see that working well for single user systems but how does it work
for multi-user ones? >>

It works the same way but not quite as well since the validation wouldn't
occur until the offending workstation started the application again.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Sep 5 2007 2:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sam,

<< Is there something I can do (property  to set) to make the db more stable
in some way? >>

Yep, see here:

http://www.elevatesoft.com/dbisam_faqt_4.htm

<< Is there a good way to automatically validate that the data files are in
one piece (or to detect if there was a dirty shutdown) ? >>

The best way is to run a VerifyTable on the tables (see above for link).
However, VerifyTable requires exclusive access and can take a while to run
on large tables, so the best way is to prevent the corruption in the first
place via FlushBuffers calls or the use of transactions.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Sep 5 2007 6:12 PMPermanent Link

"Adam H."
Hi Roy,

Tim hit it right on the head,

> I can see that working well for single user systems but how does it work
> for multi-user ones?

Tim hit it right on the head - the offending user needs to restart the
application first. I don't have anything better than that, but in the past,
when I have had an issue with users crashing out on mullti user systems, I
normally implement the DBSRVR service, and have the users connect to that.
At least if they crash- it won't affect the tables.

Cheers

Adam.

Image