Subject | problems on linux... |
---|---|
Author | Marczisovszky Daniel |
Post date | 2002-04-12T23:22:35Z |
Hi,
Well, hm... I have serious problem again. The happens only on Linux. I
have tested with both Classic and Superserver on a Debian Potato and
on a Suse 7.2 with same results. The same is happening with both
Interclient and the latest type4 driver.
I get a connection and starts reading a record from it, periodically,
but always on the same connection. If I change that record from isql,
nothing happens, I still get the previous value for that record. I've
also tried IBConsole but that did not help either. The interesting
thing I tried QuickDesk and If I change the record with that, then I
get the new value in the java program. I tried also with FIBPlus in
Delphi (QuickDesk also uses FIBPlus) but the java still shows the
previous value.
I have attached a little example application. It reads the first
record from test table in every 3 seconds always with the same
connection. (I have tried both autocommit and non-autocommit, but none
of them worked).
It runs an infinite loop. While it prints it the first record, try to
change that in isql or with IBConsole, and check if you see the new
value or not. I don't see the change.
I know that probably this is not a bug a driver, but I'm not sure,
although I can't reproduce it on Windows. Does the driver contains any
platform-specific part?
If I change the value from java (e.g. I start a separate java program)
then it works, it shows the new value.
Is there any special isolation level for isql and IBConsole I missed?
Please help, if you can! I really don't know how to cope with this.
Best wishes,
Daniel
// same database as last time, so only it has an id, username and
// passwd field
import java.sql.*;
import java.util.*;
public class conn {
public static void main( String[] args ) {
try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
String url = "jdbc:firebirdsql:localhost/3050://opt/interbase/test.gdb";
//String url = "jdbc:firebirdsql:localhost/3050:/programs/develop/firebird/test.gdb";
// we a get a connection
Connection conn = DriverManager.getConnection(url, "sysdba", "masterkey");
while (true) {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select username from test");
rs.next();
System.out.println(rs.getString(1));
// wait 3 seconds and try again
try {
Thread.sleep(3000);
}
catch (Exception ee) {}
}
}
catch(ClassNotFoundException e) {
System.err.println("Couldn't load the driver: " + e.getMessage());
}
catch(SQLException e) {
System.err.println("SQLException caught: " + e.getMessage());
}
finally {
}
}
}
Well, hm... I have serious problem again. The happens only on Linux. I
have tested with both Classic and Superserver on a Debian Potato and
on a Suse 7.2 with same results. The same is happening with both
Interclient and the latest type4 driver.
I get a connection and starts reading a record from it, periodically,
but always on the same connection. If I change that record from isql,
nothing happens, I still get the previous value for that record. I've
also tried IBConsole but that did not help either. The interesting
thing I tried QuickDesk and If I change the record with that, then I
get the new value in the java program. I tried also with FIBPlus in
Delphi (QuickDesk also uses FIBPlus) but the java still shows the
previous value.
I have attached a little example application. It reads the first
record from test table in every 3 seconds always with the same
connection. (I have tried both autocommit and non-autocommit, but none
of them worked).
It runs an infinite loop. While it prints it the first record, try to
change that in isql or with IBConsole, and check if you see the new
value or not. I don't see the change.
I know that probably this is not a bug a driver, but I'm not sure,
although I can't reproduce it on Windows. Does the driver contains any
platform-specific part?
If I change the value from java (e.g. I start a separate java program)
then it works, it shows the new value.
Is there any special isolation level for isql and IBConsole I missed?
Please help, if you can! I really don't know how to cope with this.
Best wishes,
Daniel
// same database as last time, so only it has an id, username and
// passwd field
import java.sql.*;
import java.util.*;
public class conn {
public static void main( String[] args ) {
try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
String url = "jdbc:firebirdsql:localhost/3050://opt/interbase/test.gdb";
//String url = "jdbc:firebirdsql:localhost/3050:/programs/develop/firebird/test.gdb";
// we a get a connection
Connection conn = DriverManager.getConnection(url, "sysdba", "masterkey");
while (true) {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select username from test");
rs.next();
System.out.println(rs.getString(1));
// wait 3 seconds and try again
try {
Thread.sleep(3000);
}
catch (Exception ee) {}
}
}
catch(ClassNotFoundException e) {
System.err.println("Couldn't load the driver: " + e.getMessage());
}
catch(SQLException e) {
System.err.println("SQLException caught: " + e.getMessage());
}
finally {
}
}
}