|
Home > Archive > Programming with dBASE > April 2005 > endTrans ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Bill P 2005-04-01, 8:02 pm |
| After the commit has been invoked, there are times when we are getting
messages that the transaction is still active.
I thought that the commit would close the transaction, but the messages
seem to indicate the transaction has not been closed.
I don't find any documentation for an endTrans function to compliment
the beginTrans function.
Any thoughts as to what am I missing here would be appreciated.
----------------- Bill
| |
| Martin Lambert 2005-04-01, 8:02 pm |
| Have you tried a rowset.save()
"Bill P" < bpappathopoulos@ieee
.org> a écrit dans le message de news:
F3yErzwNFHA.432@news-server...
> After the commit has been invoked, there are times when we are getting
> messages that the transaction is still active.
>
> I thought that the commit would close the transaction, but the messages
> seem to indicate the transaction has not been closed.
>
> I don't find any documentation for an endTrans function to compliment the
> beginTr ansfunction.
>
> Any thoughts as to what am I missing here would be appreciated.
>
> ----------------- Bill
>
| |
| Bill P 2005-04-02, 7:01 am |
| Martin -
Thanks for the response.
The code for this transaction is XDML and the transaction involves
writes to about four tables.
I wouldn't know how to apply a rowset.save() to this transaction.
----------- Bill
Martin Lambert wrote:
> Have you tried a rowset.save()
>
> "Bill P" < bpappathopoulos@ieee
.org> a écrit dans le message de news:
> F3yErzwNFHA.432@news-server...
>
>
>
>
| |
| Frank J. Polan 2005-04-03, 7:01 am |
| Bill,
Are you checking that the commit() was successfully. Using XDML
(haven't checked it thoroughly in OODML) if it fails you have to
manually initiate a rollback()
Frank Polan
On Fri, 01 Apr 2005 20:57:34 -0600, Bill P < bpappathopoulos@ieee
.org>
wrote:
[color=darkred]
>Martin -
>
>Thanks for the response.
>
>The code for this transaction is XDML and the transaction involves
>writes to about four tables.
>
>I wouldn't know how to apply a rowset.save() to this transaction.
>
>----------- Bill
>
>Martin Lambert wrote:
>
| |
| Bill P 2005-04-03, 7:01 am |
| Frank -
Thank you for this suggestion.
I'll look into how to confirm the commit.
------------------ Bill
Frank J. Polan wrote:
> Bill,
>
> Are you checking that the commit() was successfully. Using XDML
> (haven't checked it thoroughly in OODML) if it fails you have to
> manually initiate a rollback()
>
> Frank Polan
>
> On Fri, 01 Apr 2005 20:57:34 -0600, Bill P < bpappathopoulos@ieee
.org>
> wrote:
>
>
>
| |
| Frank J. Polan 2005-04-03, 7:01 am |
| Bill,
There's not much information on XDML transaction processing in dBASE
PLUS but there is in Visual dBASE 5.* & dBASE DOS
here's a sample
---------------------------------------------
BEGINTRANS(_) Example
The following example begins a transaction with BEGINTRANS(_). It
opens a multi-user version of Company.dbf and attempts to make all
YTD_SALES 0. ON ERROR detects any error which might occur. In
particular, it will detect if another user has locked any record in
Company.dbf. If
an error occurs, ROLLBACK(_) resets all values. Otherwise COMMIT(_)
writes the changes to disk:
CLOSE ALL
SET EXCLUSIVE OFF
BEGINTRANS()
TransErr=.f.
ON ERROR DO TransErr && Activates ON ERROR trap
USE L:\MultiUse\Company
REPLACE ALL Ytd_Sales WITH 0
ON ERROR && Disables ON ERROR
IF TransErr
? "Rollback"
ROLLBACK() && restore data
ELSE
? "Commit"
COMMIT() && save changes
ENDIF
PROC TransErr
WAIT "Warning: Transaction Fails"
TransErr=.t.
-------------------------------------------------
Try
if commit()
<some code>
else
rollback()
endif
HTH
Frank Polan
On Sat, 02 Apr 2005 09:09:19 -0600, Bill P < bpappathopoulos@ieee
.org>
wrote:
[color=darkred]
>Frank -
>
>Thank you for this suggestion.
>
>I'll look into how to confirm the commit.
>
>------------------ Bill
>
>Frank J. Polan wrote:
| |
| Bill P 2005-04-03, 7:01 am |
| Frank -
Many thanks.
----------- Bill
Frank J. Polan wrote:
> Bill,
>
> There's not much information on XDML transaction processing in dBASE
> PLUS but there is in Visual dBASE 5.* & dBASE DOS
>
> here's a sample
> ---------------------------------------------
>
> BEGINTRANS( ) Example
>
> The following example begins a transaction with BEGINTRANS( ). It
> opens a multi-user version of Company.dbf and attempts to make all
> YTD_SALES 0. ON ERROR detects any error which might occur. In
> particular, it will detect if another user has locked any record in
> Company.dbf. If
> an error occurs, ROLLBACK( ) resets all values. Otherwise COMMIT( )
> writes the changes to disk:
>
> CLOSE ALL
> SET EXCLUSIVE OFF
>
> BEGINTRANS()
>
> TransErr=.f.
> ON ERROR DO TransErr && Activates ON ERROR trap
>
> USE L:\MultiUse\Company
> REPLACE ALL Ytd_Sales WITH 0
> ON ERROR && Disables ON ERROR
>
> IF TransErr
> ? "Rollback"
> ROLLBACK() && restore data
> ELSE
> ? "Commit"
> COMMIT() && save changes
> ENDIF
>
> PROC TransErr
> WAIT "Warning: Transaction Fails"
> TransErr=.t.
> -------------------------------------------------
> Try
>
> if commit()
> <some code>
> else
> rollback()
> endif
>
> HTH
>
> Frank Polan
>
>
> On Sat, 02 Apr 2005 09:09:19 -0600, Bill P < bpappathopoulos@ieee
.org>
> wrote:
>
>
>
|
|
|
|
|