Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.252
  HXTT Cobol 5.0.251
  HXTT DBF 7.1.252
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel 6.1.255
  HXTT Json 1.0.223
  HXTT Paradox 7.1.251
  HXTT PDF 2.0.251
  HXTT Text(CSV) 7.1.251
  HXTT Word 1.1.251
  HXTT XML 4.0.252
Offshore Outsourcing
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
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
RecordLock Problem in Foxpro2.6 data table
Ajay Hendrte
2006-11-04 00:33:51
Our company is using native foxpro application on MS-DOS since last 10-12 years.
We would like to deploy new java application on fedora core 5(Linux) using same foxpro data tables those are used by existing native foxpro application over MS-DOS.
We are now testing our new java application (Linux Platform) with existing Native Foxpro application over MS-DOS simultaneously, (1 linux user java, 6 MS-DOS users(foxpro)).
We have purchased license copy of HXTT DBF Driver type 4 JDBC(1.2, 2.0, 3.0) package.
Problem :
While using our newly java based application with our existing native Foxpro application simultaneouly, we are facing the problem of RECORD LOCK Type. In multiuser environment (Java & Native Foxpro Application),when java application is going to insert a new record in foxpro table that simultaneously used by another user/s with our native foxpro application over MS-DOS , our java application straight-away 'overwrites' the same record which is locked by existing native foxpro application(another user).It could not detect lock/unlock status of record.
Our native foxpro uses 'RLOCK' command to lock record in table.
We also tested our java application with setting property locktype to FOXPRO & SoftC... but not successfull.
Which locktype should we use so that our multiuser system should work successfully.

We are very appreaciate if you give us suggesion for the same .

Thanx with regards,
Re:RecordLock Problem in Foxpro2.6 data table
HXTT Support
2006-11-04 04:04:25
>We also tested our java application with setting property locktype to FOXPRO &
> SoftC... but not successfull.
You should use lockType, not locktype, connection property. For instance, lockType=FOXPRO, or lockType=VFP.
Re:Re:RecordLock Problem in Foxpro2.6 data table
ajayhendre
2006-11-04 23:28:25
sorry its my typing mistake in this, actually already putted lockType in our java prgramme. any solution, pls urgent
Re:Re:Re:RecordLock Problem in Foxpro2.6 data table
HXTT Support
2006-11-04 23:34:38
Are you using Samba to access the database on MS-DOS from Linux? What's your Foxpro version?
Re:Re:Re:Re:RecordLock Problem in Foxpro2.6 data table
HXTT Support
2006-11-04 23:53:33
BTW, you can download the latest DBF package since you're using an older package.

>Our native foxpro uses 'RLOCK' command to lock record in table.
When one record is locking by your Foxpor, you can use "select rowno(),* from youttable where ROWLOCKED()" to list those locking rows in Java. If you failed, it means that you're using a wrong lockType. We will guide you to solve your issue step by step:)
Re:Re:Re:Re:Re:RecordLock Problem in Foxpro2.6 data table
ajayhendre
2006-11-05 10:55:22
we are using HXTT DBF Driver type 4 package,
in my java programm i used lockType foxpro and also tried lockType Softc but no use.
My native foxpro application uses "rlock", and my newly java program uses "foxpro" lockType. that mean both application using diff kind of locks
so that happens..? compatibility of lockType problem i think so.
Re:Re:Re:Re:Re:RecordLock Problem in Foxpro2.6 data table
ajayhendre
2006-11-05 10:56:12
we are using HXTT DBF Driver type 4 package,purchased in last month.
in my java programm i used lockType foxpro and also tried lockType Softc but no use.
My native foxpro application uses "rlock", and my newly java program uses "foxpro" lockType. that mean both application using diff kind of locks
so that happens..? compatibility of lockType problem i think so.
Re:Re:Re:Re:Re:Re:Re:RecordLock Problem in Foxpro2.6 data table
ajayhendre
2006-11-05 10:58:26
i mounted that windows shared folder on linux .
Re:Re:Re:Re:Re:Re:Re:Re:RecordLock Problem in Foxpro2.6 data table
ajayhendre
2006-11-05 10:59:45
i m using foxpro 2.6 dos based version.
Re:Re:Re:Re:Re:Re:Re:Re:RecordLock Problem in Foxpro2.6 data table
HXTT Support
2006-11-05 16:54:07
>i m using foxpro 2.6 dos based version.
HXTT should support it. We tested it with Foxpro 2.5b, Foxpro 2.5b (x) DOS, and Foxpro2.6(X) for DOS.

>It could not detect lock/unlock status of record.
Now let us use the testLock6 sample to make sure that HXTT DBF can work normally with your Foxpro at the same PC first. You can modify the url and aTable value to do you test. Note: we doesn't test Samba in that test case.

import java.sql.*;
import java.util.Properties;

public class testLock6 {

public static void main(String argv[]) {
try {
String url="jdbc:dbf:/c:/foxpro26";
String aTable="test";
/* in Foxpro, run those commands below:
cd c:/foxpro25
SET REPROCESS TO 3 SECONDS
use test shared
brow
?rlock('3','test')
In another MS_DOS command line, run javat -cp DBF_JDBC30.jar;./ testLock6 and you will see that HXTT DBF has detected correctly the lock status
unlock (record 3 now)
In another MS_DOS command line, run javat -cp DBF_JDBC30.jar;./ testLock6 again and you will see that HXTT DBF has detected correctly the lock status
*/


// String url="jdbc:dbf:/";
// String aTable="\\\\PII333\\c$\\test\\Orders.dbf";
/* in Foxpro, run those command below:
cd //pii333/c$/test
SET REPROCESS TO 3 SECONDS
use orders shared
brow
?rlock('3','orders')
In another MS_DOS command line, run javat -cp DBF_JDBC30.jar;./ testLock6 and you will see that HXTT DBF has detected correctly the lock status
unlock (record 3 now)
In another MS_DOS command line, run javat -cp DBF_JDBC30.jar;./ testLock6 again and you will see that HXTT DBF has detected correctly the lock status
*/


Class.forName("com.hxtt.sql.dbf.DBFDriver");

Properties properties = new Properties();

// properties.put("lockType","VFP");
properties.put("lockType","FOXPRO");

Connection con = DriverManager.getConnection(url, properties);
Statement stmt = con.createStatement();

String sql;

sql="SELECT RowLocked(),* FROM "+aTable+" WHERE RECNO()==3";

System.out.println(sql+":");

ResultSet rs=stmt.executeQuery(sql);
ResultSetMetaData resultSetMetaData = rs.
getMetaData();
int iNumCols = resultSetMetaData.getColumnCount();
for (int j = 1; j <= iNumCols; j++) {
System.out.println(resultSetMetaData.getColumnLabel(j));
}
while (rs.next()) {
for (int j = 1; j <= iNumCols; j++) {
System.out.print(rs.getObject(j) + " ");
}
System.out.println();
}
rs.close();

stmt.close();
con.close();
}catch (SQLException sqle) {
do {
System.out.println(sqle.getMessage());
System.out.println("Error Code:" + sqle.getErrorCode());
System.out.println("SQL State:" + sqle.getSQLState());
sqle.printStackTrace();
}
while ( (sqle = sqle.getNextException()) != null);
}
catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}



>i mounted that windows shared folder on linux .
If you passed the above test case, we can begin to test Samba lock now. If failed, stop to do more test, and let us know your OS for Foxpro. You need only to modify the url and aTable value to do Samba lock test.

Let us know your test result:)




Re:Re:Re:Re:Re:Re:Re:Re:RecordLock Problem in Foxpro2.6 data table
HXTT Support
2006-11-06 23:42:13
The conclusion is that Java's NIO lock is lame at Linux for Samba sometimes. The latest DBF package can detect OS version, and skip that issue with JNI lock.

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap