Search in sources :

Example 11 with ModelContext

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);
}
Also used : ModelContext(com.genexus.ModelContext) ServerPreferences(com.genexus.ServerPreferences)

Aggregations

ModelContext (com.genexus.ModelContext)11 HttpContext (com.genexus.internet.HttpContext)3 ServerPreferences (com.genexus.ServerPreferences)1 UserInformation (com.genexus.db.UserInformation)1 HttpContextNull (com.genexus.internet.HttpContextNull)1 HttpRequest (com.genexus.internet.HttpRequest)1 GXResult (com.genexus.security.GXResult)1 OutData (com.genexus.security.OutData)1 IHttpServletRequest (com.genexus.servlet.http.IHttpServletRequest)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 Method (java.lang.reflect.Method)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1 JSONArray (json.org.json.JSONArray)1 JSONObject (json.org.json.JSONObject)1