Hello,
We are using Pervasive SQL 2000i v7.94 on Win NT 4.0 server SP6.
I am trying to write a JAVA-Application with the Java driver fom
March-2003.
The application is a production application that must run continuosly.
part of the code follows :
public static void main(String[] args) {
Statement ps = null;
ResultSet rs = null;
try {
Driver d =
(Driver)Class.forName("com.pervasive.jdbc.v2.Drive r").newInstance();
if (DEBUG) {
int maV = d.getMajorVersion();
int miV = d.getMinorVersion();
String v = " v" + maV + "." + miV;
System.out.println("Driver " + aDriver + v + " loaded.
");
}
} catch (Exception e) {
e.printStackTrace();
}
try {
Connection con =
DriverManager.getConnection("jdbc

ervasive://NTSERVER:1583/MYDB");
} catch (SQLException ex) {
ex.printStackTrace();
}
for (int i=0; i<1000000; i++) {
for (int place=1; place<=49; place++) {
try {
ps = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
rs = ps.executeQuery("SELECT * FROM MYTABLE where
COL1 = 11
and COL2 = " + String.valueOf(place));
if (rs.next()) {
int newStatus = 0;
int oldStatus = rs.getInt("STATUS");
if ( oldStatus== 1)
newStatus = 2;
else
newStatus = 1;
int count = ps.executeUpdate(
"UPDATE MYTABLE SET STATUS =" +
String.valueOf(newStatus) +
" WHERE CO1 = 11 AND COL2 =" +
String.valueOf(place)
);
if (count < 1 ) System.err.println("Error by
update");
System.out.println("place " + place);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
if ( rs != null ) {
rs.close();
rs = null;
}
if ( ps != null ) {
ps.close();
ps = null;
}
} catch (Exception e) {};
}
}
// Sleep 1s.
PsTools.sleep(1000);
}
con.close();
}
}
For testing purposes this application is the only one that runs on the
DB.
The service NTDBSMGR allocates memory increasingly until it hangs or
crashes.
Has someone any idea ?
Kindly regards,
A. Didiot