Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Next consecutive problem...
Message
From
28/04/2002 19:25:38
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00646071
Message ID:
00650195
Views:
17
Mario,

I have a couple of multi store apps which update to head office each night.

Each store has a unique store number (001, 002, 003 etc.) and each store has a keyfile.dbf which contains all the .dbf file names in the database along with its next key number...


When a new record is added I save the following as the PK field...
gcStorenum+PADL(ALLTRIM(STR(keyfile.nextidnum)),10,'0')
...this gives me a 13 character Primary Key.

Every store (or customer in your case) can have a unique Primary Key and totally sequential for that store (customer).

>I need to obtain the following thing:
>
>I need to generate I number consecutive, without there are jumps among them, so that it
>admits the handling of multiple clients, each one acquiring following the next consecutive respecting the order.
>The great problem is that the transaction is slow (take approx 10-30 sec) and can have but of 8 clients
>soliciing a consecutive one To the time...
>
>This is:
>
>Client 1 begins the transaction, asks for the next consecutive, he acquires the consecutive 1
>client 2 begins the transaction and client 1 has not finished. The client 2 MUST WAIT until client 1 confirm or cancels the transaction,
>and to acquire consecutive the consecutive number 2
>
>I Try placing the IsolationLevel=adXactIsolated property but he does not work...
>
>The only idea i have is to use a flag, but exists one better solution?
>
>Thanks
>
>(Ok, this problem rely in a not so good bd structure, but i don't can change that now)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform