use of com.genexus.ModelContext in project JavaClasses by genexuslabs.
the class ServerDBConnectionManager method disconnect.
public void disconnect(int handle) throws SQLException, NullPointerException {
UserInformation ui = getUserInformation(handle);
if (onDisconnectProcName != null && !ApplicationContext.getInstance().isServletEngine()) {
try {
if (onDisconnectProcName.equals("")) {
ServerPreferences pref = ServerPreferences.getInstance(com.genexus.Application.class);
onDisconnectProcName = pref.getOnDisconnectProcName();
}
if (ui != null && onDisconnectProcName != null) {
// El proc de desconexi�n es un proc que toma como parametro un entero (el handle de la conexi�n)
try {
com.genexus.db.DynamicExecute.dynamicExecute(new ModelContext(ServerDBConnectionManager.class), handle, Application.class, onDisconnectProcName, new Object[] { new Integer(handle) });
} catch (Throwable e) {
System.err.println("OnDisconnectProc -> ");
e.printStackTrace();
}
}
} catch (Throwable ex) {
// Si no puedo abrir el server.cfg ya no lo intento en el proximo disconnect
onDisconnectProcName = null;
}
}
super.disconnect(handle);
}
Aggregations