diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9dfc81f3bf..1674412a9d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,15 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2003-02-25 22:10 UTC+0300 Alexander Kresin + * contrib/rdd_ads/adsfunc.c + + Transaction processing functions added. + * contrib/rdd_ads/ads.ch + + New commands added: + BEGIN TRANSACTION + COMMIT TRANSACTION + ROLLBACK TRANSACTION + 2003-02-18 22:05 UTC+0100 Tomaz Zupan * include/hbdbf.h * include/hbdbsort.h diff --git a/harbour/contrib/rdd_ads/ads.ch b/harbour/contrib/rdd_ads/ads.ch index 07599f949f..0c3f04ffb9 100644 --- a/harbour/contrib/rdd_ads/ads.ch +++ b/harbour/contrib/rdd_ads/ads.ch @@ -117,3 +117,9 @@ => AdsSetCharType( if( upper( <(x)> ) == "OEM", 2, 1 ) ) #command COMMIT => AdsWriteAllRecords() + +#command BEGIN TRANSACTION => AdsBeginTransaction() + +#command COMMIT TRANSACTION => AdsCommitTransaction() + +#command ROLLBACK TRANSACTION => AdsRollbackTransaction() diff --git a/harbour/contrib/rdd_ads/adsfunc.c b/harbour/contrib/rdd_ads/adsfunc.c index 5a16581df5..da5b5dc560 100644 --- a/harbour/contrib/rdd_ads/adsfunc.c +++ b/harbour/contrib/rdd_ads/adsfunc.c @@ -1274,6 +1274,36 @@ HB_FUNC( ADSGETCONNECTIONHANDLE ) hb_retni( adsConnectHandle ); } +HB_FUNC( ADSBEGINTRANSACTION ) +{ + hb_retnl( AdsBeginTransaction( (hb_pcount()>1)? (ADSHANDLE)hb_parnl(1) : adsConnectHandle ) ); +} + +HB_FUNC( ADSCOMMITTRANSACTION ) +{ + hb_retnl( AdsCommitTransaction( (hb_pcount()>1)? (ADSHANDLE)hb_parnl(1) : adsConnectHandle ) ); +} + +HB_FUNC( ADSROLLBACKTRANSACTION ) +{ + hb_retnl( AdsRollbackTransaction( (hb_pcount()>1)? (ADSHANDLE)hb_parnl(1) : adsConnectHandle ) ); +} + +HB_FUNC( ADSFAILEDTRANSACTIONRECOVERY ) +{ + hb_retnl( AdsFailedTransactionRecovery( (ISCHAR(1))? hb_parc(1) : NULL ) ); +} + +HB_FUNC( ADSINTRANSACTION ) +{ + UNSIGNED16 pbInTrans; + + if( AdsInTransaction( (hb_pcount()>1)? (ADSHANDLE)hb_parnl(1) : adsConnectHandle,&pbInTrans ) ) + hb_retl( (int) pbInTrans ); + else + hb_retl( 0 ); +} + HB_FUNC( ADSGETLASTERROR ) { /* nLastErr := AdsGetLastError( [ @cLastErr ] ) */