OW2 Consortium rmijdbc

Compare Revisions

Ignore whitespace Rev 43 → Rev 44

/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJResultSetServer.java
78,7 → 78,9
jdbcResultSet_ = s;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
protected void finalize() throws Throwable {
if(jdbcResultSet_ != null) jdbcResultSet_.close();
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJDriverServer.java
55,7 → 55,9
admpasswd_ = admpasswd;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
/**
* Administrative methods
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJResultSetMetaDataServer.java
32,7 → 32,9
metadata_ = md;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
/**
* What's the number of columns in the ResultSet?
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJConnectionServer.java
72,7 → 72,7
jdbcConnection_ = null;
}
//System.out.println("RJConnectionServer: unreferenced() -> doing garbage collection");
Runtime.getRuntime().gc();
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
 
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJStatementServer.java
41,7 → 41,9
jdbcStatement_ = s;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
protected void finalize() throws Throwable {
if (jdbcStatement_ != null) jdbcStatement_.close();
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJSavepointServer.java
25,7 → 25,9
jdbcSavepoint_ = s;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
public int getSavepointId() throws RemoteException, SQLException {
return jdbcSavepoint_.getSavepointId();
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJArrayServer.java
34,7 → 34,9
jdbcArray_ = a;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
/**
* Retrieves the contents of the SQL array designated by this Array object
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJBlobServer.java
48,7 → 48,9
jdbcBlob_ = b;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
public long length() throws RemoteException, SQLException {
return jdbcBlob_.length();
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJClobServer.java
31,7 → 31,9
jdbcClob_ = b;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
// TBD There's a hack there (InputStream not serializable)
// public Reader getCharacterStream() throws RemoteException, SQLException {
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJParameterMetaDataServer.java
26,7 → 26,9
jdbcParameterMetaData_ = s;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
public String getParameterClassName(int param)
throws RemoteException, SQLException {
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJCallableStatementServer.java
59,7 → 59,9
jdbcCallableStmt_ = c;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
/**
* Before executing a stored procedure call, you must explicitly
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJPreparedStatementServer.java
50,7 → 50,9
jdbcPrepStmt_ = p;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
/**
* A prepared SQL query is executed and its ResultSet is returned.
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJJdbcServer.java
50,6 → 50,8
static boolean startreg_ = true;
static String admpasswd_ = null;
 
static boolean explicitgc_ = false;
 
public static boolean verboseMode = true;
 
static boolean installRMISecurityMgr = false;
67,6 → 69,11
static DriverManager dummy_for_gc;
 
/**
* To force explicit Runtime.getRuntime().gc() calls in unreferenced() methods
*/
public static boolean explicitGC() { return explicitgc_; }
 
/**
* Process the command-line parameters
*/
static void processArgs(String args[])
87,6 → 94,8
hash.put("-ssl",new Integer(4));
 
hash.put("-passwd",new Integer(5));
 
hash.put("-explicitgc",new Integer(6));
hash.put("-?",new Integer(99));
hash.put("?",new Integer(99));
152,6 → 161,10
System.exit(1);
}
break;
 
case 6:
explicitgc_ = true;
break;
case 99:
RJJdbcServer.printUsage();
167,7 → 180,7
static void printUsage() {
 
System.out.println(
"Usage:\tjava org.objectweb.rmijdbc.RJJdbcServer [-noreg] [-port port] [-lp port] [-sm] [-ssl] [driver]*");
"Usage:\tjava org.objectweb.rmijdbc.RJJdbcServer [-noreg] [-port port] [-lp port] [-sm] [-ssl] [-passwd admPassword] [-explicitgc] [driver]*");
 
System.out.println(
"-noreg: No internal registry, requires rmiregistry to be started");
181,6 → 194,8
"-ssl: Run in SSL mode (both javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword must be defined");
System.out.println(
"-passwd: specify an administrative password");
System.out.println(
"-explicitgc: force explicit garbage collector calls when RMI server objects are released (may slow down server performance)");
System.out.println("[driver]*: A list of JDBC driver classes");
}
 
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJDatabaseMetaDataServer.java
49,7 → 49,9
jdbcMetadata_ = d;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
//----------------------------------------------------------------------
// First, a variety of minor information about the target database.
/trunk/RmiJdbc/src/org/objectweb/rmijdbc/RJRefServer.java
33,7 → 33,9
jdbcRef_ = r;
}
 
public void unreferenced() { Runtime.getRuntime().gc(); }
public void unreferenced() {
if(RJJdbcServer.explicitGC()) Runtime.getRuntime().gc();
}
 
public String getBaseTypeName() throws RemoteException, SQLException {
return jdbcRef_.getBaseTypeName();