2007-02-12 16:50 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/contrib/rdd_ads/ads1.c
    * do not release FLOCK() after DBAPPEND() - only RLOCKs should be
      removed
  * harbour/contrib/rdd_ads/rddads.h
    * set ADS_REQUIRE_VERSION when not set by user scripts
This commit is contained in:
Przemyslaw Czerpak
2007-02-12 15:52:52 +00:00
parent 36d66abf4d
commit 65ef23e405
3 changed files with 34 additions and 17 deletions

View File

@@ -8,6 +8,13 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-02-12 16:50 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
* do not release FLOCK() after DBAPPEND() - only RLOCKs should be
removed
* harbour/contrib/rdd_ads/rddads.h
* set ADS_REQUIRE_VERSION when not set by user scripts
2007-02-12 10:50 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/pp/ppcore.c
! fix line numbering when preprocess static buffers, f.e. by

View File

@@ -1294,7 +1294,7 @@ static ERRCODE adsAppend( ADSAREAP pArea, BOOL fUnLockAll )
AdsAtEOF( pArea->hTable, &u16Eof );
}
if( fUnLockAll )
if( fUnLockAll && pArea->fShared && !pArea->fFLocked )
{
SELF_RAWLOCK( ( AREAP ) pArea, FILE_UNLOCK, 0 );
}
@@ -1302,22 +1302,25 @@ static ERRCODE adsAppend( ADSAREAP pArea, BOOL fUnLockAll )
u32RetVal = AdsAppendRecord( pArea->hTable );
if( u32RetVal == AE_SUCCESS )
{
ULONG ulRecNo;
/*
* Brian, please ask about it ExtSys guys.
* Does it create race condition (the implicit lock is removed
* and then the explicit one set) or just simply the flag indicating
* lock type is changed only. We have to know that.
* Without explicit locking the lock on appended record will be
* removed on any record movement or flushing. It may cause very
* serious synchronization problems in programs written for other
* RDDs and then ported to ADS. Druzus.
*/
if( SELF_RECNO( ( AREAP ) pArea, &ulRecNo ) == SUCCESS )
if( pArea->fShared && !pArea->fFLocked )
{
/* to avoid unnecessary record refreshing after locking */
pArea->fPositioned = TRUE;
SELF_RAWLOCK( ( AREAP ) pArea, REC_LOCK, ulRecNo );
ULONG ulRecNo;
/*
* Brian, please ask about it ExtSys guys.
* Does it create race condition (the implicit lock is removed
* and then the explicit one set) or just simply the flag indicating
* lock type is changed only. We have to know that.
* Without explicit locking the lock on appended record will be
* removed on any record movement or flushing. It may cause very
* serious synchronization problems in programs written for other
* RDDs and then ported to ADS. Druzus.
*/
if( SELF_RECNO( ( AREAP ) pArea, &ulRecNo ) == SUCCESS )
{
/* to avoid unnecessary record refreshing after locking */
pArea->fPositioned = TRUE;
SELF_RAWLOCK( ( AREAP ) pArea, REC_LOCK, ulRecNo );
}
}
pArea->fBof = FALSE;
pArea->fEof = FALSE;

View File

@@ -51,7 +51,7 @@
*/
#ifndef ADS_REQUIRE_VERSION
/*#define ADS_REQUIRE_VERSION 6*/
#define ADS_REQUIRE_VERSION 5
#endif
#include "hbapirdd.h"
@@ -60,6 +60,13 @@
#endif
#include "ace.h"
#undef ADS_MAX_KEY_LENGTH
#if ADS_REQUIRE_VERSION >= 8
#define ADS_MAX_KEY_LENGTH 4082 /* maximum key value length. This is the max key length */
#else /* of ADI indexes. Max CDX key length is 240. Max */
#define ADS_MAX_KEY_LENGTH 256 /* NTX key length is 256 */
#endif
HB_EXTERN_BEGIN