Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transaction and Views.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00328069
Message ID:
00328989
Vues:
19
Thanks for the insight.

Still working more to it. Will Update You.

Aashish
>>Hello friends,
>>
>>Need a suggestion for a problem.
>>
>>Iam working on a financial accounting package where the frontend is VFP and backend is Oracle.
>>Problem is :
>>
>>I need to update few updatable views (Tables of Oracle) with the latest value while i perform a update in transaction. Now as im using
>>Begin Transaction and End Transaction the problem faced is that in case if other user update in oracle table in between the process of my transaction execution i get wrong values as a result. For eg.
>>
>
>Are you using VFP transactions or Oracle transactions? I'm more familiar with MSSQL-Server, but either way declaring a VFP transaction does not begin a SQL transaction - they are very different animals.
>
>Regardless of the transaction mechanism, design your transactions to take as little time as possible. This is considered good practice because it increases the availability of data to all users, and has performance benefits as well.
>
>The idea is to get all your data retrieved, calculated, etc., and THEN start the transaction. Issue all your TABLEUPDATE()'s and/or SQL pass-through UPDATES and INSERTS. Then, if they all were successful, Commit it; otherwise Roll it back.
>>
>
>
>>a view field consisting of a value 1000 other users update to 1000+500
>>hence in table of oracle i get 1500 but my view in transaction has a value of 1000 which is wrong. Hence all my operation at this time on view is with old value.
>>
>
>If there's just one value being changed by a multiple users, the update will run so fast that conflicts are unlikely. It's different entirely if, in the middle of a transaction, you create temporary cursors in Oracle, or some other dog-slow operation. Gather and calculate on your data _before_ starting the transaction.
>
>>Using Requery() can be a solution but not the best as it takes time and looses my record pointer which number of times creats problem.
>>
>
>VFP transactions prohibit executing a REQUERY() between BEGIN TRANS and END TRANS. You cannot requery ANY remote (or local) view during a VFP transaction. This does not, however, prohibit retrieving data from Oracle via SQL Pass-Through. While you *can* do this during a VFP transaction, I don't recommend it. Focus instead on making your transactions small and fast.
>
>To handle Oracle transactions, you should consider setting manual/automatic transactions to Manual in the Connection Designer, or in code at runtime. The default is automatic - probably not what you want.
>
>Another angle would be to use SQL transactions and avoid VFP transactions completely. Let's say you have two remote views. If each view has a separate connection handle into Oracle, in theory you could begin a transaction on one handle, but still requery the other remote view.
>
>Hope this helps!
>
>
>>Aashsih
--
--
Aashish Sharma
Tele Nos: +1-201-490-5405
Mobile: +91-9821053938
E-Mail:
aashish@aashishsharma.com
write2aashish@gmail.com

You better believe in yourself... if you don't, who else will ?
TODAY is a gift, that's why it's called PRESENT
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform