albfernandez / javadbf

Java library for reading and writing Xbase (dBase/DBF) files.
GNU Lesser General Public License v3.0
224 stars 98 forks source link

Data confusion #84

Closed Qumans closed 11 months ago

Qumans commented 3 years ago

reader.nextRecord(); When reading a large batch of database data, the values returned by the fields are all confused.

com.linuxense.javadbf.DBFReader#nextRecord

eg: Field{FieldA FieldB FieldC FieldD} value{"AA","BB","CC","DD"; "AA","BB","CC","DD"; "AA","BB","CC","DD";} read result: Field{FieldA FieldB FieldC FieldD} value{"A","ABB",null,"CCDDA"; "A","BBCC","null","DD"; "A","ABB","CCD","D";}

When I add a thread to sleep between two reader.nextRecord(); eg: image

it is worked for we;

But this is more time-consuming, I hope you can solve it

albfernandez commented 3 years ago

Hi

some questions to debug this.

Qumans commented 3 years ago

What version of javadbf are you using?         1.9.2  and 1.11.1 and 1.11.2

How do you create javadbfReader?         FTPClient ftp = util.getFTPClient(ftpHost, Integer.parseInt(ftpPort), ftpUserName,ftpPassword);         InputStream in = ftp.retrieveFileStream(new String(file.getName().getBytes("GBK"),"GBK"));         DBFReader reader = new DBFReader(in);

Are you using javadbf from more than one thread? (javadbf is not thread safe)         no,I use in single thread

how big is your file? Does it ocurrs on small files?         about 6M,20000 records;   Haven't tried small files

the file is located on a network drive, a local harddisk or ssd?         on FTP ;

------------------ 原始邮件 ------------------ 发件人: "albfernandez/javadbf" @.>; 发送时间: 2021年4月16日(星期五) 凌晨1:01 @.>; @.**@.>; 主题: Re: [albfernandez/javadbf] Data confusion (#84)

Hi

some questions to debug this.

What version of javadbf are you using?

How do you create javadbfReader?

Are you using javadbf from more than one thread? (javadbf is not thread safe)

how big is your file? Does it ocurrs on small files?

the file is located on a network drive, a local harddisk or ssd?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

albfernandez commented 3 years ago

have you tried to wrap your inputStream in a BufferedInputStream? or download to a temporary local file and then read from this?

albfernandez commented 3 years ago

I've released 1.13, check if it works for you