Re: cannot clear dmRecAttrDirty bit, help please

2009-03-22 Thread Roger Stringer
Without looking at your code I can say that you have a program bug of 
your own making!


Are you starting with a clean database for your testing?  If not you 
could have fixed the bug and not know it.


Sequence is supposed to be:
1) Open/create record
2) Read/write to record
3) Release record

Note: You don't so much clear the bit, as not actually ever set it in 
the first place.


At 03:15 AM 3/22/2009, you wrote:

Subject: RE: cannot clear dmRecAttrDirty bit, help please
From: Darren adelph...@yahoo.co.uk
Date: Sat, 21 Mar 2009 03:01:27 -0700
X-Message-Number: 1

am using DmReleaseRecord() to close the record directly after 
DmWrite() is finished writing the records.


Cannot find any other function that closes records ?

It appears like the database is protected by the system, as no 
record attributes can be changed ?


Darren


Roger Stringer
Marietta Systems, Inc. (www.rf-tp.com)


--
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


RE: cannot clear dmRecAttrDirty bit, help please

2009-03-21 Thread Darren
am using DmReleaseRecord() to close the record directly after DmWrite() is 
finished writing the records.

Cannot find any other function that closes records ?

It appears like the database is protected by the system, as no record 
attributes can be changed ?

Darren



-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-20 Thread Darren
have tried DmReleaseRecord() in a loop, 0-maxrecords-1,
before database close which is before application quit.
-Does not work.
So have tried using DmSetRecordInfo() to set other record attrs.,
but they do not work either ?

So, nvfs(nand), involves the database being backed up to the non-volatile 
storage on database create, database close and also on
DmSetRecordInfo(), 
is it perhaps this that is causing the bug ?
Does anyone know ?

many thanks for all help
regards
Darren




-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-20 Thread Dmitry Grinberg
you only need to close records you opened.
and stop blaming nvfs, as bad as it may be, YOUR problems are far
greater, and not related to nvfs

Best Regards,
Dmitry Grinberg
(847) 226 9295



On Fri, Mar 20, 2009 at 9:42 AM, Darren adelph...@yahoo.co.uk wrote:
 have tried DmReleaseRecord() in a loop, 0-maxrecords-1,
 before database close which is before application quit.
 -Does not work.
 So have tried using DmSetRecordInfo() to set other record attrs.,
 but they do not work either ?

 So, nvfs(nand), involves the database being backed up to the non-volatile 
 storage on database create, database close and also on
 DmSetRecordInfo(),
 is it perhaps this that is causing the bug ?
 Does anyone know ?

 many thanks for all help
 regards
 Darren




 --
 For information on using the ACCESS Developer Forums, or to unsubscribe, 
 please see http://www.access-company.com/developers/forums/


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


RE: cannot clear dmRecAttrDirty bit, help please

2009-03-20 Thread Philip Sheard
I felt like saying that myself. The bit about NVFS, that is.

-Original Message-
From: Dmitry Grinberg [mailto:dmitr...@gmail.com] 
Sent: 20 March 2009 18:20
To: Palm Developer Forum
Subject: Re: cannot clear dmRecAttrDirty bit, help please

you only need to close records you opened.
and stop blaming nvfs, as bad as it may be, YOUR problems are far
greater, and not related to nvfs

Best Regards,
Dmitry Grinberg
(847) 226 9295



On Fri, Mar 20, 2009 at 9:42 AM, Darren adelph...@yahoo.co.uk wrote:
 have tried DmReleaseRecord() in a loop, 0-maxrecords-1,
 before database close which is before application quit.
 -Does not work.
 So have tried using DmSetRecordInfo() to set other record attrs.,
 but they do not work either ?

 So, nvfs(nand), involves the database being backed up to the non-volatile
storage on database create, database close and also on
 DmSetRecordInfo(),
 is it perhaps this that is causing the bug ?
 Does anyone know ?

 many thanks for all help
 regards
 Darren




 --
 For information on using the ACCESS Developer Forums, or to unsubscribe,
please see http://www.access-company.com/developers/forums/


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe,
please see http://www.access-company.com/developers/forums/


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-19 Thread Darren


if (attrdmRecAttrDirty)
  attr = ~dmRecAttrDirty;

still no success.
have tried dmNewHandle/dmAttachRecord.
dmAttachRecord() sets the dirty bit.
Using a resource editor it is possible to change the bit.

many thanks for help
regards
Darren


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-19 Thread Regis St-Gelais
Darren adelph...@yahoo.co.uk a écrit dans le message de news: 
187...@palm-dev-forum...


Have a look at
Err DmReleaseRecord (DmOpenRef dbP, UInt16 index, Boolean dirty)

Purpose
Clear the busy bit for the given record and set the dirty bit if dirty is 
true.


-- 
Regis St-Gelais
www.laubrass.com 



-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-18 Thread Darren
no success,

1) attr = ~dmRecAttrDirty; 
  after the record has been written, does not work.

2) have tried both 
   attr = ~dmRecAttrDirty
  and
   attr = 0;
  in a loop (0 to max records-1) at application stop, before the database is 
closed. Also does not work.

many thanks and
regards
Darren


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-16 Thread Bodo Wenzel
 attr-=dmRecAttrDirty;
Please use

attr = ~dmRecAttrDirty;

as /subtracting/ is not the appropriate method to clear a bit!

However, did you try to clear the bit after releasing the record? It's quite 
likely that the OS saves the dirty bit at some intermediate location.

HTH
Bodo


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-16 Thread Lionscribe
I am not sure if you tried this, but I am sure that you should change the dirty 
attr after MemHandleUnlock, and after DmRelease record, and probably after 
DmInsertionSort (just you will first have to find the record, since the index 
has changed during the sort. Use the id).
Lionscribe

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-14 Thread Darren

1) The goto statement is useful for 'code optimization' (reducing byte size of 
.c source files). 
X amount of returns incase of errors means having to, for example,
-reset draw state before return
-close and/or release any number of handles/ptrs
-close open files/ filestreams/databases
- etc., etc. and so on
- before each return statement

2)if hotsync's are infrequent, for instance once a week, or month or year, then 
the backlog of files that have dmRecAttrDirty set can cause the synchronisation 
process to take hours instead of minutes.

Still have not found a solution, the bit is set even when
DmReleaseRecord(GLB-DBRF, index, 0) is used.
On nvfs devices databases are automatically backed up to the dbcache on 
database close, database create, a call to DmSetDatabaseInfo(), or upon device 
sleep (open databases only). (See 
http://www.accessdevnet.com/docs/palmos/PalmOSReference/DataAndResourceManager.html#1053148)

Is there a way of clearing the dmRecAttrDirty ??


many thanks and
regards
Darren
-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


cannot clear dmRecAttrDirty bit, help please

2009-03-13 Thread Darren
Hello (Palm TX/nvfs)
am trying, unsuccessfuly, to clear the dirty bit on new records 
(records that dont need syncing, etc.), have tried a few methods, please see 
following code :



// ••
// RecordAdd
Int8
RecordAdd(Global *GLB)
{
// text from fields
ASCII nameF[20];
ASCII *ptr1=FldGetTextPtr(GLB-F1P);
ASCII *ptr2=FldGetTextPtr(GLB-F2P);
MemSet(nameF, 20, NULL);
MemMove(nameF, ptr1, StrLen(ptr1));

// record
Err err;
MemHandle newH;
UINT16 index=dmMaxRecordIndex;



UINT32 size=20+StrLen(ptr2)+1;
if (!(newH=DmNewRecord(GLB-DBRF, index, size)))
  {
  txtDialogue(0x00, 75, DmNewRecord err, 0);
  return 0x10;
  }

ASCII *recPtr=(ASCII*)MemHandleLock(newH);

if (DmWrite(recPtr, 0, nameF, 20))
  {
  txtDialogue(0x00, 75, DmWrite name err, 0);
  err=0x30;
  goto CLEANUP;
  }

if (DmWrite(recPtr, 20, ptr2, size-20))
  {
  txtDialogue(0x00, 75, DmWrite description err, 0);
  err=0x40;
  goto CLEANUP;
  }



// THIS IS WHERE THE dmRecAttrDirty bit IS CLEARED,
// PROCESSES WITH NO ERRORS, BUT WHEN THE DATABASE IS CHECKED
// USING A RESOURCE EDITOR THE 'DIRTY' FLAG IS SET?
// HAVE TRIED PUTTING THIS CODE BEFORE DATABASE IS CLOSED DURING
// StopApp() AND ALSO SETTING attr=0, NEITHER METHOD WORKS.
//clear dmRecAttrDirty ???
UINT16 attr;
if (DmRecordInfo(GLB-DBRF, index, attr, 0, 0))
  {
  txtDialogue(0x00, 75, DmRecordInfo err, 0);
  return 0x40;
  }
attr-=dmRecAttrDirty;
if (DmSetRecordInfo(GLB-DBRF, index, attr, 0))
  {
  txtDialogue(0x00, 75, DmSetRecordInfo err, 0);
  return 0x50;
  }


CLEANUP:
MemHandleUnlock(newH);

if (DmReleaseRecord(GLB-DBRF, index, 0))
  {
  txtDialogue(0x00, 75, DmReleaseRecord err, 0);
  return 0x20;
  }

// sort
if ( DmInsertionSort(GLB-DBRF,
   (DmComparF*)SortComparF, 0) )
   txtDialogue(0x00, 75, DmInsertionSort err, 0);


// THE FOLLOWING IS AN ATTEMPT TO SEND A sysNotifySyncFinishEvent
// TO TRY AND CLEAR THE dmRecAttrDirty BIT, BUT THE DEVICE RESETS.
/* clear dmRecAttrDirty ???  
SysNotifyParamType notifyParams;
notifyParams.notifyType = sysNotifySyncFinishEvent;
notifyParams.broadcaster = 'sync';
// sysNotifyBroadcasterCode  DeskCrID  'sync'
notifyParams.notifyDetailsP = NULL;
notifyParams.userDataP = NULL;
notifyParams.handled = false;
if ( SysNotifyBroadcastDeferred(notifyParams, 0) )
  {
  txtDialogue(0x00, 75, SysNotifyBroadcast err, 0);
  //return 0x60;
  }
**/
return errNone;
}


Any help appreciated, many thanks
regards
Darren
-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: cannot clear dmRecAttrDirty bit, help please

2009-03-13 Thread Ryan Rix
First of all, why are you using goto? Didn't that die with BASIC? There are
1000 better ways to structure your code than goto statements.

Second, imo dirty bit is used as information for [rogram, and isn't really
changed by it, only by the APIs.
See
http://www.accessdevnet.com/docs/palmos/PalmOSReference/DataAndResourceManager.html#1011051

On Fri, Mar 13, 2009 at 9:10 AM, Darren adelph...@yahoo.co.uk wrote:

 Hello (Palm TX/nvfs)
 am trying, unsuccessfuly, to clear the dirty bit on new records
 (records that dont need syncing, etc.), have tried a few methods, please
 see following code :

 /** CODE REMOVED BECAUSE LYRIS DENIED MY MESSAGE **/

 Any help appreciated, many thanks
 regards
 Darren
 --
 For information on using the ACCESS Developer Forums, or to unsubscribe,
 please see http://www.access-company.com/developers/forums/




-- 
Thanks and best regards,
Ryan Rix
TamsPalm - The PalmOS Blog
(623)-239-1103 -- Grand Central, baby!

Jasmine Bowden - Class of 2009, Marc Rasmussen - Class of 2008, Erica
Sheffey - Class of 2009, Rest in peace.

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/