Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Ahsan Rana
  Where is Ahsan Rana?
 Lahore
 Pakistan
 Ahsan Rana
 Tags
Subject: RE: Table Lock in MySql
Thread ID: 373413 Message ID: 373580 # Views: 29 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Saturday, March 23, 2013 5:19:25 PM         
   


> >
> > Instead of that create a sequence table
> >
> > CREATE TABLE invoicesequence ( id int NOT NULL auto_increment, dummy char(1))
> >
> > Then insert into this
> > insert into invoicesequence (dummy) values ('')
> >
> > and get the last insert id for your next invoice number. You can then delete the inserted row. No need to lock a table. Table locking will slow down the database if lots of users are using at the same time.
> >
> > Regards
> > Tushar
> > http://weblogs.foxite.com/tushar/
>
> Ok Tushar, I understand your logic, but the problem is if any user save any invoice and immediately due to any reason deleted that (last saved) invoice then the deleted invoice number should be blank.
>
> Rgds:
> Ahsan Rana

In a multi user system, you cannot say that somebody else will not have already inserted another invoice in the meantime. So you cannot reuse a deleted invoice.

Regards
Tushar
http://weblogs.foxite.com/tushar/

ENTIRE THREAD

Table Lock in MySql Posted by Ahsan Rana @ 3/22/2013 3:32:58 AM
RE: Table Lock in MySql Posted by Tom Saddul @ 3/22/2013 5:36:17 AM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/22/2013 11:36:41 AM
RE: Table Lock in MySql Posted by llyrad atsituab @ 3/23/2013 2:50:17 AM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 10:36:07 AM
RE: Table Lock in MySql Posted by Tom Saddul @ 3/23/2013 10:47:07 AM
RE: Table Lock in MySql Posted by llyrad atsituab @ 3/23/2013 2:43:08 AM
RE: Table Lock in MySql Posted by Tom Saddul @ 3/23/2013 5:05:02 AM
RE: Table Lock in MySql Posted by llyrad atsituab @ 3/22/2013 6:17:50 AM
RE: Table Lock in MySql Posted by tushar @ 3/23/2013 10:56:27 AM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 11:23:28 AM
RE: Table Lock in MySql Posted by tushar @ 3/23/2013 11:54:05 AM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 12:39:57 PM
RE: Table Lock in MySql Posted by tushar @ 3/23/2013 1:14:54 PM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 4:44:38 PM
RE: Table Lock in MySql Posted by tushar @ 3/23/2013 5:19:25 PM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 6:08:36 PM
RE: Table Lock in MySql Posted by Om Rajan @ 3/23/2013 9:31:19 PM
RE: Table Lock in MySql Posted by Tom Saddul @ 3/23/2013 12:12:06 PM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 12:41:11 PM