db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: How to monitor progress during data import
Date Wed, 26 Jul 2006 15:27:01 GMT

Andreas Korneliussen wrote:
> Fantry, John wrote:
>> I am using Derby to import a large text file into a table.  I would 
>> like to be able to display a progress dialog to the user while the 
>> import is processing.  In order to provide a useful progress bar I 
>> need to be able to calculate the % complete of the import procedure.  
>> Does anyone know if this can be done?  The table is locked during the 
>> import so I can't execute any SELECT COUNT(*) statements in a separate 
>> thread.  Perhaps Derby outputs some statistics to a log file?  I did 
>> stumble across the RunTimeStatistics attribute in the Derby docs, but 
>> this attribute is only meaningful after the import is complete.  I 
>> need insight into the import procedure while it's executing.  Any ideas?
> Have you tried running the SELECT COUNT (*) statement using transaction 
> isolation level "read-uncommitted " ?
Do note that derby must scan all the rows in the table to execute 
count(*), so checking on the progress using count(*) is a significant
overhead depending on the size of the table.

For your application it may be possible to layer a stream on top of the
file which could tell your app how much has been read while otherwise
just passing the bytes from the file to derby.
> Regards
> Andreas

View raw message