Home » RDBMS Server » Performance Tuning » Locking Table
Locking Table [message #64844] Wed, 18 February 2004 20:42 Go to next message
Qavi
Messages: 24
Registered: August 2002
Junior Member
Hello,

       i have a talbe for Generating document number in incremental manner by 1, i have a document type INV which is invoked by multiple users to issue invoices, this is getting locked and users have to hangup till it gets unlocked , my procedure is this

PROCEDURE invoice IS
   docno number;
   showalert number;
   cursor gal_inv is select brd_no+1 from abs.t_documents  for update of brd_no nowait;   
begin
       fetch gal_inv into docno; 
        if :cust_acno2 is null then
          update abs.t_documents set brd_no = docno ;
          :invno1 := docno;
        else
          update abs.t_documents set brd_no = (docno+1) ;
          :invno1 := docno;           
          :invno2 := docno+1; 
        end if;
        commit;
      close gal_inv;
   end if;

end;

 

users have to wait for atleast 2 mins till the transaction gets commited and table gets released .

its urgent please

thx in advance

Qavi
Re: Locking Table [message #64852 is a reply to message #64844] Thu, 19 February 2004 07:29 Go to previous message
Michel Bartov
Messages: 35
Registered: February 2003
Member
Consider using Oracle sequence number instead of a table.

Michel.
Previous Topic: Index Performance - autotrace on explain
Next Topic: SYSTEM STATISTICS
Goto Forum:
  


Current Time: Tue Jan 19 22:15:33 CST 2021