Hi folks!

I wonder if someone has ever used free tables in a transaction. IOW, I need 
to know how to use istransactable(), maketransactable() and how does it 
work. I find the help text somewhat confusing.

This is the text from help

quote

When MAKETRANSACTABLE( ) is used to make a free table or free cursor support 
transactions, the free table or free cursor supports transactions in all 
work areas and data sessions in which it is opened.

MAKETRANSACTABLE( ) makes all open instances of a free table or free cursor 
support transactions, including those in other data sessions within a single 
instance of VFP.

If a free table that does not support transactions is open in more than one 
data session, the free table cannot be made to support transactions. 
However, you can open a free table that already supports transactions in 
additional data sessions.

If row buffering is enabled, then a table update is performed if the free 
table or free cursor has pending changes before the free table or free 
cursor is made to support transactions. You cannot use MAKETRANSACTABLE( ) 
to enable transactions for a free table that has table buffering enabled.
To disable transactions for a free table, you must close the free table in 
all data sessions.

ISTRANSACTABLE

Specifies the work area of the free table or free cursor for which 
ISTRANSACTABLE( ) determines if transactions are supported.

cAlias
Specifies the alias of the table or cursor for which ISTRANSACTABLE( ) 
determines if transactions are supported.

Return Value
Logical. Returns a logical true (.T.) if a free table or free cursor 
supports transactions, otherwise a logical false (.F.) is returned.

unquote

Here's what I do:
use mytable shared
if not istransactable('mytable')
   maketransactable('mytable')
endif

QUESTIONS

If I use two separate forms, each with a private data session, and I make a 
free table transactable in one of them, will it be transactable in the other 
form?
The wording in the first paragraph of help suggests that the table will be 
transactable in both forms. However, the way the second paragraph is written 
baffles me a little bit. Does it mean that, because the above code was run 
in the first form, the second one does not need to check for the 
transactability of the table with ISTRANSACTABLE?

I have a system where the user constantly opens different forms that use the 
free table, in some of them for consultation only but in others for editing 
the table.

So, what is the best way to use both functions? Because I often get the 
error message that the table is not transactable when I use the above code, 
even when the table was made transactable in another form, by the same user.

BTW, I use VFP9 with SP1

TIA

Rafael Copquin

 


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/005501c9a48c$456edd40$6401a...@rafaelpc
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to