Question RE Cursor Types and Locking 
Author Message
 Question RE Cursor Types and Locking

We are developing an application that tracks our clients time, then allows
the client to create invoices based upon the time entered. Typically, the
time is calculated using a timer controlled by the user.  When one party
(the "Invoicer") is creating an invoice, another user (the "User") may be in
the process of editing (using the timer) on of the items that will be
included on the invoice being processed by the Invoicer.  The User has
access to all of the User's records until the particular record's invoice
field is populated with an invoice number (this is normally determined when
the User starts the application).  Once the invoice has been finalized, we
do not want the User to be able to edit or change the time record in any way
(the record should always match the amount billed).

What is the best way to set cursor types and locks on recordsets created for
the Invoicer and the User in this situation?  We are currently using the
Microsoft.Jet.OLEDB.4.0 provider and have set the Cursor Location, Cursor
Type, and Locking as follows:

User: adUseServer, adOpenKeyset, adLockOptimistic
Invoicer: adUseServer, adOpenKeyset, adLockOptimistic

Should we be using adLockPessimistic for the Invoicer?  This merely prevents
the User from editing the record while the Invoicer is in the process of
changing the record, but does not prohibit the user from editing the record
after the Invoicer is finished with it, right?

Any guidance greatly appreciated!

Thanks,

Dan



Wed, 27 Apr 2005 03:40:44 GMT
 Question RE Cursor Types and Locking

Hi Daniel,
My Suggestions are to either add a yes no field to the
table and have the invoicer routines set it to yes.
Then add some code to the edit/open routines that checks
the field and won't allow it to be edited if the value is
yes.
Another way of doing it would be to archive the records
included in an invoice to a seperate table, delete them
from the first table, then lock the archive table so it
can only be read.
Also you do want to go with a pessemistic locktype so
that the inviocer and user can't open the records at the
same time.
HTH
Ed Voss
MCP
Quote:
>-----Original Message-----
>We are developing an application that tracks our clients
time, then allows
>the client to create invoices based upon the time

entered. Typically, the
Quote:
>time is calculated using a timer controlled by the

user.  When one party
Quote:
>(the "Invoicer") is creating an invoice, another user

(the "User") may be in
Quote:
>the process of editing (using the timer) on of the items
that will be
>included on the invoice being processed by the

Invoicer.  The User has
Quote:
>access to all of the User's records until the particular
record's invoice
>field is populated with an invoice number (this is

normally determined when
Quote:
>the User starts the application).  Once the invoice has
been finalized, we
>do not want the User to be able to edit or change the

time record in any way
Quote:
>(the record should always match the amount billed).

>What is the best way to set cursor types and locks on

recordsets created for
Quote:
>the Invoicer and the User in this situation?  We are
currently using the
>Microsoft.Jet.OLEDB.4.0 provider and have set the Cursor
Location, Cursor
>Type, and Locking as follows:

>User: adUseServer, adOpenKeyset, adLockOptimistic
>Invoicer: adUseServer, adOpenKeyset, adLockOptimistic

>Should we be using adLockPessimistic for the Invoicer?  

This merely prevents
Quote:
>the User from editing the record while the Invoicer is
in the process of
>changing the record, but does not prohibit the user from
editing the record
>after the Invoicer is finished with it, right?

>Any guidance greatly appreciated!

>Thanks,

>Dan

>.



Wed, 27 Apr 2005 06:13:18 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Yet Another ADO Cursor Location / Lock Type Question

2. Seem unable to set recordset cursor location, type, lock type

3. Cursor functionality, Lock Types and cursor locations

4. ADO cursor location and cursor type question

5. ADO Cursor Location and Cursor Type question

6. Type of ADO Cursor and Lock to Use

7. Question: cursor type and stored procedures

8. ADO Recordset Cursor Types & Connections Question

9. Question about cursors and locking

10. Question on Lock types and performance

11. cursor variable type and deallocating the cursor instance?

12. Question about DBMS_SQL cursor and PL/SQL cursor


 
Powered by phpBB® Forum Software