Phil,
It sounds like you could have 1 of the following:
1) Not always setting the static db ref to NULL when you close the db and
then using it later.
2) Corruption after adding or changing or deleting a record.
Maybe you have a helper array of structs that changes based on
record changes?
Like going over 64 KB or getting an error when growing and plowing
on anyway?
See if you can reproduce using a 4.0 Debug ROM and POSE 3.1 (or later)
This combo does the strictest checks and will usually find subtle bugs
earlier.
Hopefully a single gremlin can make it happen. I have the debugger already
hooked to POSE and then start just 1 gremlin for say 100,000 events.
Some things to try (probably 1 at a time):
For your Debug build add code that does a db "consistency check" for each
record and for any special rules about your db. Only for the Debug build as
this slows your app. Make sure to check each record after you add/change
it.
Also if you are moving deleted records to the end of the db like some Palm
apps do,
make sure that you don't have any deleted records followed by non deleted
records.
Comment out any way to Delete a record. Bug still happens?
Comment out any way to Change a record. " "
IF these don't help you should probably post the call stack and the code
that ran just before and during when the bug happened. May not be just db
code to suspect...
HTH,
Randy Maxwell
-----Original Message-----
From: Phil Hodge [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 14, 2001 2:59 AM
To: Palm Developer Forum
Subject: Weird probs when lots of records
Hi all,
I have been stuck with this problem for a while: my application has two
databases, one which can get quite large.
I have been experiencing crashes when accessing the database under certain
conditions, for example when I have up to 1000 records in there, but the app
seems completely fine when there are only a couple of hundred.
I have a database module with a global static DmOpenRef handle, which is
opened when the app is started. Mostly, accessing the database with this
handle is trouble free, but sometimes it seems to become corrupt, and any Dm
call will cause a Fatal Error. This is a reproducible error.
I can't understand why the number of records makes a difference. Indebug,
the address of the database reference is always fine, and never changes, and
the index I use is also fine, yet ' DmRecordInfo(dbr,index,NULL,NULL,NULL)'
will immediately cause a fatal error. I use DmGetLastError everywhere but
all db calls are fine prior to this. I check all database return codes -
fine.
My only clue is the CodeWarrior debug log:
Address error exception at 0x10c1deee (PrvRecordEntryPtr).
Does anyone have any suggestions? I'm out of ideas.
Thanks
Phil Hodge
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/