Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT DBF
Corrupted index on foxpro table
Rob Gansevles
2013-05-30 23:51:59.0
Hi,

We are using the dbf driver from Servoy and one of our customers reports issues with index corruption.

It can be reproduced with a table called pdaten (structure with 104 fields p_nr autoinc with index, name character...) (I can send you the table if needed) using the sample program shown below.

Scenario:

1. Started java program
2. Created one record in the program (id 1)
3. Checked index in the table (id 1): ok
4. Created 5 records in the table with foxpro (id 2 to 6)
5. Checked index (id 2 to 6): ok
6. Created one record with the java program (id 7)
7. Checked index in the table (id1) : ok
8. Checked index in the table (id2) : set filter to p_nr = 2 results no record
9. Checked index in the table (id3) : set filter to p_nr = 3 results no record
10. Checked index in the table (id4) : set filter to p_nr = 4 results no record
11. Checked index in the table (id5) : set filter to p_nr = 5 results no record
12. Checked index in the table (id6) : set filter to p_nr = 6 results no record
13. Checked index in the table (id7) : ok

I hope you have enough information to investigate this error.

Regards,
Rob Gansevles,
Servoy


////// sample program ///////
public static void main(String[] args) throws Exception
{
String url = "jdbc:DBF:/C:/DBFTest?lockType=VFP";
String tableName = "pdaten";
String inccol = "p_nr";
String othercol = "name";

Class.forName("com.hxtt.sql.dbf.DBFDriver");
java.sql.Connection connection = java.sql.DriverManager.getConnection(url, "", "");

connection.setTransactionIsolation(java.sql.Connection.TRANSACTION_READ_COMMITTED);

connection.setAutoCommit(false);

while (true)
{
System.out.print("Hit RETURN to insert a new value");
if (System.in.read() <= 0)
{
break;
}

java.sql.PreparedStatement ps = connection.prepareStatement("insert into " + tableName + " (" + othercol + ") values ('test')");
ps.executeUpdate();
ps.close();

ps = connection.prepareStatement("select currval('" + tableName + "','" + inccol + "')");
java.sql.ResultSet rs = ps.executeQuery();
if (rs.next())
{
System.out.println("generated: " + rs.getInt(1));
}
else
{
System.err.println("no result");
}
rs.close();
ps.close();

System.out.print("Hit RETURN to commit");
if (System.in.read() <= 0)
{
connection.rollback();
System.out.println("Rolled back");
break;
}
connection.commit();
System.out.println("Committed");
System.out.println();
}

connection.close();
System.out.println("Done");
}
Re:Corrupted index on foxpro table
HXTT Support
2013-05-31 06:37:15.0
Passed test according to your description.
First
create table pdaten (p_nr int auto_increment primary key, name varchar(12));

Then run your sample, and commited one row with p_nr=1
Now open VFP 9.0,
run
USE pdaten SHARED
SET INDEX TO pdaten.idx
browse
and insert 5 rows ( p_nr=2,3,4,5,6)

Now continue run Java sample ,and insert one row with p_nr=7
set filter to p_nr = 2(1,3...7) ok.


Re:Re:Corrupted index on foxpro table
Rob Gansevles
2013-05-31 07:20:02.0
Thanks for the quick response.
I have sent a zipfile with dbf files in a separate email to support@hxtt.com

Regards,
Rob
Re:Re:Re:Corrupted index on foxpro table
HXTT Support
2013-05-31 20:01:55.0
Still work normally with CDX sample. Please download the latest version, and check whether you will meet issue.
Re:Re:Re:Re:Corrupted index on foxpro table
M. Harms Briese Schiffahrts GmbH & Co.KG
2013-06-02 23:23:08.0
Hello,
have you received the pdaten.dbf from Rob Gansevles (Servoy)? This file containes 104 fields. Can you test it with this file?
I have tested it with this file several times. This index file will always be corrupt (we are using Windows 7 x64).
1. Started java program
2. Created one record in the program (id 1)
3. Foxpro: use pdaten shared, browse. We can see all records
In Foxpro 9 SP3: set filter to p_nr = 1: found the record
4. Created 5 records in the table with foxpro (id 2 to 6)
5. browse. We can see all records
In Foxpro 9 SP3: set filter to p_nr = 2: found the record
In Foxpro 9 SP3: set filter to p_nr = 3: found the record
In Foxpro 9 SP3: set filter to p_nr = 4: found the record
In Foxpro 9 SP3: set filter to p_nr = 5: found the record
In Foxpro 9 SP3: set filter to p_nr = 6: found the record
6. Created one record with the java program (id 7)
7. Foxpro: browse. We can see all records
In Foxpro 9 SP3: set filter to p_nr = 1: found the record
In Foxpro 9 SP3: set filter to p_nr = 2: no record found
In Foxpro 9 SP3: set filter to p_nr = 3: no record found
In Foxpro 9 SP3: set filter to p_nr = 4: no record found
In Foxpro 9 SP3: set filter to p_nr = 5: no record found
In Foxpro 9 SP3: set filter to p_nr = 6: no record found
In Foxpro 9 SP3: set filter to p_nr = 7: found the record
Re:Re:Re:Re:Re:Corrupted index on foxpro table
HXTT Support
2013-06-03 05:40:12.0
>Can you test it with this file?
Tested normally on XP.

Please let us know your HXTT DBF version.
Re:Re:Re:Re:Re:Re:Corrupted index on foxpro table
M. Harms Briese Schiffahrts GmbH & Co.KG
2013-06-03 06:11:41.0
We have Version 5.1.137 on May 13, 2013.
Where can I find the file to test? Can you send it to edv@briese.de?
Re:Re:Re:Re:Re:Re:Re:Corrupted index on foxpro table
HXTT Support
2013-06-03 07:54:45.0
Sent the test sample. If you can recur that issue, please email support at hxtt.com the sample too.
Re:Re:Re:Re:Re:Re:Re:Re:Corrupted index on foxpro table
HXTT Support
2013-06-05 03:31:06.0
2013-06-05 fixed an insert bug for VFP compatible mode on CDX index file which contains more than one indexed expression.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap