rlock() and dbunlock() in Replaceing DBF 
Author Message
 rlock() and dbunlock() in Replaceing DBF

Hello ! I am a Junior Clipper Programmer , here is some problem I face.
Anyone can give me some Tips ? Thank you !

I'm open a DBF with 6 index files in Novell netware server, then I appand
data to this DBF. This DBF have 60,000 records.

dbselectarea( "TEMPDBF" )
do while !eof()
   dbselectarea( "DBF" )
   if dbappend()  // --------------- Point 1
      __FIELD->DBF->FIELD_1 := TEMPDBF->FIELD_1
      __FIELD->DBF->FIELD_2 := TEMPDBF->FIELD_2
      __FIELD->DBF->FIELD_3 := TEMPDBF->FIELD_3
      dbunlock()  // ------------- Point 2
   endif
   dbselectarea( "TEMPDBF" )
   dbskip(1)
enddo

When every run to ther Point 1 and Point 2 , the speed is very slow,
dbappend() and dbunlock() use 15 to 30 min. How can I SPEED UP ?
Thank You for our help !




Tue, 10 Nov 1998 03:00:00 GMT  
 rlock() and dbunlock() in Replaceing DBF



Quote:
>Hello ! I am a Junior Clipper Programmer , here is some problem I face.
>Anyone can give me some Tips ? Thank you !

>I'm open a DBF with 6 index files in Novell netware server, then I appand
>data to this DBF. This DBF have 60,000 records.

>dbselectarea( "TEMPDBF" )
>do while !eof()
>   dbselectarea( "DBF" )
>   if dbappend()  // --------------- Point 1
>      __FIELD->DBF->FIELD_1 := TEMPDBF->FIELD_1
>      __FIELD->DBF->FIELD_2 := TEMPDBF->FIELD_2
>      __FIELD->DBF->FIELD_3 := TEMPDBF->FIELD_3
>      dbunlock()  // ------------- Point 2
>   endif
>   dbselectarea( "TEMPDBF" )
>   dbskip(1)
>enddo

>When every run to ther Point 1 and Point 2 , the speed is very slow,
>dbappend() and dbunlock() use 15 to 30 min. How can I SPEED UP ?
>Thank You for our help !



We Michaels must stick together ...

Are you running in test mode or are others already hammering the system?

As far as I can recall, dbappend() will need to gain control of the file
header for a short period of time.  So, it will do an flock() internally
and then when it completes it will leave the appended record rlock()ed.

Can you be sure where the 20-30 minutes is happening?   Can you measure
the time() just before and just after Point 1?  And before and after
Point 2?  If, as I suspect, the delay is in dbappend() you will have to
think of another strategy for adding records.

What others have done is to ensure that there are always a number of
blank and deleted records available on the file.  Then you can modify
your append to the following ...

set deleted off
seek for a blank record
lock it
recall it
set deleted on
add the fields
unlock it

No file lock is required.

Keep us posted with how you do.

Mike

--
Mike Pitcher : Tel: +44 1844-275209 :
PAM Limited  : Fax: +44 1844-275210 :
HP27 0NB UK  :                      :



Tue, 10 Nov 1998 03:00:00 GMT  
 rlock() and dbunlock() in Replaceing DBF



Quote:
>Hello ! I am a Junior Clipper Programmer , here is some problem I face.
>Anyone can give me some Tips ? Thank you !

>I'm open a DBF with 6 index files in Novell netware server, then I appand
>data to this DBF. This DBF have 60,000 records.

>dbselectarea( "TEMPDBF" )
>do while !eof()
>   dbselectarea( "DBF" )
>   if dbappend()  // --------------- Point 1
>      __FIELD->DBF->FIELD_1 := TEMPDBF->FIELD_1
>      __FIELD->DBF->FIELD_2 := TEMPDBF->FIELD_2
>      __FIELD->DBF->FIELD_3 := TEMPDBF->FIELD_3
>      dbunlock()  // ------------- Point 2
>   endif
>   dbselectarea( "TEMPDBF" )
>   dbskip(1)
>enddo

>When every run to ther Point 1 and Point 2 , the speed is very slow,
>dbappend() and dbunlock() use 15 to 30 min. How can I SPEED UP ?
>Thank You for our help !



Another thought.

If you can gain exclusive use of the file, take all the indices off, do
all your appends and then rebuild the indices.

Keep us posted.

--
Mike Pitcher : Tel: +44 1844-275209 :
PAM Limited  : Fax: +44 1844-275210 :
HP27 0NB UK  :                      :



Tue, 10 Nov 1998 03:00:00 GMT  
 rlock() and dbunlock() in Replaceing DBF

Thank you for your help !
I thank I cannot exclusive use this DBF because there are multi-user will
update this DBF and rebuild index files need so much time.
It will stop other use to update this DBF. Thank You !


Quote:


> >Hello ! I am a Junior Clipper Programmer , here is some problem I face.
> >Anyone can give me some Tips ? Thank you !

> >I'm open a DBF with 6 index files in Novell netware server, then I
appand
> >data to this DBF. This DBF have 60,000 records.

> >dbselectarea( "TEMPDBF" )
> >do while !eof()
> >   dbselectarea( "DBF" )
> >   if dbappend()  // --------------- Point 1
> >      __FIELD->DBF->FIELD_1 := TEMPDBF->FIELD_1
> >      __FIELD->DBF->FIELD_2 := TEMPDBF->FIELD_2
> >      __FIELD->DBF->FIELD_3 := TEMPDBF->FIELD_3
> >      dbunlock()  // ------------- Point 2
> >   endif
> >   dbselectarea( "TEMPDBF" )
> >   dbskip(1)
> >enddo

> >When every run to ther Point 1 and Point 2 , the speed is very slow,
> >dbappend() and dbunlock() use 15 to 30 min. How can I SPEED UP ?
> >Thank You for our help !


> Another thought.

> If you can gain exclusive use of the file, take all the indices off, do
> all your appends and then rebuild the indices.

> Keep us posted.

> --
> Mike Pitcher : Tel: +44 1844-275209 :
> PAM Limited  : Fax: +44 1844-275210 :
> HP27 0NB UK  :                      :



Wed, 11 Nov 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. DBUNLOCK error / error de DBUNLOCK

2. HARBOUR-project : Error DBF/1001 Open error: Arbeider.dbf

3. dbf/ntx to dbf/idx converter

4. Which is best DBF editor for viewing Clipper based dbf files( windows)

5. DbRlock/DbUnlock takes a very long time...

6. UNLOCK/DbUnlock() takes a very long time

7. DBUNLOCK error

8. DBU DBF FILE nad FOXPRO 2.6A dbf file

9. Help - Clipper 5 DBF files not recognised by other applications - Job_divn.dbf (0/1)

10. Help - Clipper 5 DBF files not recognised by other applications - Job_divn.dbf (1/1)

11. Error DBunlock Internal 1210

12. Problem with error dbunlock 1210

 

 
Powered by phpBB® Forum Software