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.
|
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.
|
>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.
|