dbTalk Databases Forums  

Memory probleme on NTDBSMGR with JDBC

comp.databases.btrieve comp.databases.btrieve


Discuss Memory probleme on NTDBSMGR with JDBC in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Didiot Alexandre
 
Posts: n/a

Default Memory probleme on NTDBSMGR with JDBC - 12-14-2004 , 06:45 AM






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("jdbcervasive://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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.