Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursorsetprop(buffering,5,0) and create cursor ??
Message
De
11/06/2004 13:58:58
 
 
À
11/06/2004 09:26:11
Suhas Hegde
Dental Surgeon
Sirsi, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00912173
Message ID:
00912828
Vues:
28
>Hi,
>
>>>Other wise what would be the use in making a cursor transactable? when this does not defaults to 5 and should always be set manually.
>
>I mean is by making the cursor transactable U have opened a lot new ways to do in a transaction.
>We all use buffering(Then why not provide one?) with/for transactions. AFAIK there are only two ways of creating and using ( no way of using the use command but it happens ?? when create is called) a cursor. (How to USE a cursor without using again ?? whereas tables can be opened with/out the use of again)
>
>1) Create Cursor abcd (f1 I)
>2) select - command (readwrite)
>both return with buffering 1
>
>Agreed(Infact very happy that the cursors now can be included in transactions) that U have offered the cursor to be transactable when its buffering status is 1in contrast to other table/view/spt cursors where it is 5.
>
>The table/views have an optional use command when done would follow the cursorsetprop properties.
>But there is no use command with cursors.
>
>To use cursors it would be the way round like use dbf('').. again... which opens respecting cursorsetproperties.
>
>So
>
>create cursor abcd(abc C(10))
>use dbf('abcd') in 0 again alias abcd1
>
>
>now to make the abcd cursor transactable would require abcd1 to be set to buffering 1
>So all those cursors opened again with the use would require buffering 1 (what if they have pending changes as buffering is respected ?)
>
> Otherwise making the cursor transactable first and then to re-USE it would do.




I don't understand, why all this escapade with USE AGAIN? Isn't it simple enough to set 'Buffering' to the value you need? Table buffering is supported for transactable cursors.
CLEAR 
SET MULTILOCKS ON

CREATE CURSOR foo (f1 I)
?maketransactable()
CURSORSETPROP("Buffering",5)
?ALIAS(),CURSORGETPROP("Buffering")
INSERT INTO foo VALUES (1)
LIST
BEGIN TRANSACTION 
INSERT INTO foo VALUES (2)
INSERT INTO foo VALUES (3)
LIST 
ROLLBACK 
LIST
>If second is the case then why not make the cursors transactable by default when created ?
>


This will sure break a lot of applications, that is why there must be an explicit action to make a cursor transactable. It is very easy to do, just one function call. So, call it after CREATE CURSOR.

Thanks,
Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform