Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
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
DBF show errror "The process cannot access the file because it is being used by another process"
corocota
2012-11-23 01:32:08.0
Hi,

We have a Java6 web application that uses DBF JDBC 4.0 Driver to access some dbf files in a shared network folder (only read access, SELECT ). Those DBF files are used too by another legacy application (I think is made with Clipper).

Both applications had been working togheter about 1 month without problems, but lately our application is showing errors because it cannot access dbf files that says are blocked by other process.

The cause exception is:

Caused by: java.sql.SQLException: Failed to load table resoluc:java.io.FileNotFoundException: \\up999999\SGC\ORDENES\resoluc.dbf (The process cannot access the file because it is being used by another process)
at com.hxtt.global.SQLState.SQLException(Unknown Source)
at com.hxtt.sql.dbf.j.void(Unknown Source)
at com.hxtt.sql.dbf.j.long(Unknown Source)
at com.hxtt.sql.dbf.d.a(Unknown Source)
at com.hxtt.sql.dbf.d.(Unknown Source)
at com.hxtt.sql.dbf.x.a(Unknown Source)
at com.hxtt.sql.bx.if(Unknown Source)
at com.hxtt.sql.dz.a(Unknown Source)
at com.hxtt.sql.dz.a(Unknown Source)
at com.hxtt.sql.dc.a(Unknown Source)
at com.hxtt.sql.bx.a(Unknown Source)
at com.hxtt.sql.am.a(Unknown Source)
at com.hxtt.sql.d1.executeQuery(Unknown Source)

The question is:

Is there any way our aplicattion can read the dbf files although they may be locked. We only need to make a SELECT from the tables.

If FAQ Concurrence Questions 5 says we can use property lockType to enable Xbase compatible lock

Properties prop=new Properties();
prop.setProperty( "lockType", "CLIPPER" );
Connection conn=DriverManager.getConnection( url,prop );

How do this work? We will be able to read from a locked table or our application will wait until lock is released?

In the same FAQ Concurrence Questions 5 says we don't need to add the JNIFile.dll into our library path if we are using JDBC4.0 and JVM1.6. It is this correct?

Any help or suggestions will be appreciated.

Thanks in advance.
Re:DBF show errror
corocota
2012-11-23 03:38:24.0
One more thing.

I don't know exactly which version of Clipper was used in the another application. What kind of difference there is using "CLIPPER" or "CLIPPER5.3" as value for property "lockType"?

Regards.
Re:Re:DBF show errror
HXTT Support
2012-11-23 05:34:00.0
>Is there any way our aplicattion can read the dbf files although they may be
>locked. We only need to make a SELECT from the tables.
You can use delayedClose=0 connection property and remove lockType connection property. But it won't detect and wait exclusive lock release.

>Both applications had been working togheter about 1 month without problems, but
> lately our application is showing errors because it cannot access dbf files
> that says are blocked by other process.
>The cause exception is:
>Caused by: java.sql.SQLException: Failed to load table
> resoluc:java.io.FileNotFoundException: \\up999999\SGC\ORDENES\resoluc.dbf (The
> process cannot access the file because it is being used by another process)
That happened because your legacy application is exclusive open that file that time.

>prop.setProperty( "lockType", "CLIPPER" );
>Connection conn=DriverManager.getConnection( url,prop );
>How do this work? We will be able to read from a locked table or our
> application will wait until lock is released?
CLIPPER is enough in most time, and CLIPPER5.3 is a seldom version. A longer lockTimeout connection property will let your application to wait exclusive lock release.

>we don't need to add the JNIFile.dll into our library path if we are using JDBC4.0 and JVM1.6. It is this correct?
Yeah. You needn't JNIFile.dll since HXTT DBF can detect automatically Java VM version.

So the conclusion is lockType=CLIPPER with a longer lockTimeout connection property should work for your project.








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