静默回滚事务

@param conn Connection
15187
private void quietRollback(Connection conn) {
		if (null != conn) {
			try {
				conn.rollback();
			} catch (Exception e) {
				StaticLog.error(e);
			}
		}
	}
889684
private void cleanupConnection(Connection conn, ResultSet rs, PreparedStatement statement) {

		logger.logp(Level.FINEST, CLASSNAME, "cleanupConnection", "Entering",  new Object[] {conn, rs==null ? "<null>" : rs, statement==null ? "<null>" : statement});

		if (statement != null) {
			try {
				statement.close();
			} catch (SQLException e) {
				throw new PersistenceException(e);
			}
		}

		if (rs != null) {
			try {
				rs.close();
			} catch (SQLException e) {
				throw new PersistenceException(e);
			}
		}

		if (conn != null) {
			try {
				conn.close();
			} catch (SQLException e) {
				throw new PersistenceException(e);
			} finally {
				try {
					conn.close();
				} catch (SQLException e) {
					throw new PersistenceException(e);
				}
			}
		}
		logger.logp(Level.FINEST, CLASSNAME, "cleanupConnection", "Exiting");
	}
750538
public static void commitAndClose(Connection conn) throws SQLException {
        if (conn != null) {
            try {
                conn.commit();
            } finally {
                conn.close();
            }
        }
    }
998069
@Override
    public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent event) {
        // register the newly established channel
        Channel channel = event.getChannel();
        LOG.info("connection established to :{}, local port:{}", client.getRemoteAddr(), channel.getLocalAddress());

        client.connectChannel(ctx.getChannel());
        client.handleResponse(ctx.getChannel(), null);
    }
272205
private void closeConnection( IConnection conn )
    {
        try
        {
            if( conn != null && conn.isOpen() )
                conn.close();
        }
        catch ( OdaException e )
        {
            // ignore
            e.printStackTrace();
        }
    }
1103371
public void init(HttpInboundConnection conn, SessionManager sessMgr) {
        this.connection = conn;
        this.request = conn.getRequest();
        this.sessionData = new SessionInfo(this, sessMgr);
    }
646677
public void removeConnection(WebSocketConnection conn) {
        conns.remove(conn);
        for (IWebSocketDataListener listener : listeners) {
            listener.onWSDisconnect(conn);
        }
    }
163796
function handleConnection(conn, conf, appParams)
{
    var requiredApp = null;
    var runningApp = null;
    var runningAppID = null;
    var buffer = "";

    // console.log("New connection from [" + conn.remoteAddress + "]");

    conn.on('data', function (message)
    {
        var pkg;
        var strMessage = buffer + message.toString();
        pkg = strMessage.split("\n");

        if (strMessage.substr(-1) !== "\n")
        {
            buffer = pkg.pop();
        }

        pkg.map(function (jsonPkg)
        {
            if (jsonPkg.length < 2)
            {
                return;
            }

            var o = JSON.parse(jsonPkg);
            switch (o["a"])
            {
                case "x":
                    // if the alias exists: executes it
                    if (conf["aliases"] && conf["aliases"][o["w"]])
                    {
                        var tmpLog = "Starting [" + o["w"] + "] ...";
                        try
                        {
                            requiredApp = r_equire(global.__base_path + conf["aliases"][o["w"]]);
                            tmpLog += "OK!";

                            runningApp = requiredApp({
                                "send": function (m)
                                {
                                    conn.write(m);
                                },
                                "close": function ()
                                {
                                    runningApp.app.destroyAll();
                                    conn.close();
                                }
                            }, appParams);
                        }
                        catch (e)
                        {
                            requiredApp = null;
                            runningApp = null;
                            tmpLog += "ERROR [" + e + "]!";
                        }

                        if (runningApp !== null)
                        {
                            // registers the app
                            runningAppID = registerRunningApp(runningApp);
                            // enables the broadcasting
                            injectBroadcasting(runningApp);
                        }

                        console.log(tmpLog);
                    }
                    else
                    {
                        console.log('Error: Alias [' + o["w"] + '] not found!');
                    }
                    break;
                default:
                    // packages handled by the app itself
                    runningApp && runningApp.parseRequests(o);
            }

        });

    });
    conn.on('close', function ()
    {
        runningApp && runningApp.onClose();

        if (runningAppID !== null)
        {
            unregisterRunningApp(runningAppID);
        }
    });
    conn.on('error', function ()
    {
        runningApp && runningApp.onError();

        console.log("Connection ERROR!!!");
    });
}
1077531
public void init(HttpInboundConnection conn, RequestMessage req) {
        this.request = req;
        this.response = conn.getResponse();
        this.connection = conn;
        this.outStream = new ResponseBody(this.response.getBody());
        this.locale = Locale.getDefault();
    }
1104052
protected void destroyConnection(ConnectionHandle conn) {
		postDestroyConnection(conn);
		conn.setInReplayMode(true); // we're dead, stop attempting to replay anything
		try {
				conn.internalClose();
		} catch (SQLException e) {
			logger.error("Error in attempting to close connection", e);
		}
	}
1371303
public static void close(Connection conn) {
        if (conn != null) {
            try {
                conn.close();
            } catch (SQLException ex) {
                logger.error("", ex);
            }
        }
    }
285875
@Override
    public void registerConnectionChangeListener(ConnectionChangeListener listener) {
        connectionListeners.add(listener);
        executor.execute(() -> listener.connectionChange(this, isConnected()));
    }
295979
@Override
    public void setConnection(RTMPConnection conn) {
        log.trace("Adding connection: {}", conn);
        int id = conn.getId();
        if (id == -1) {
            log.debug("Connection has unsupported id, using session id hash");
            id = conn.getSessionId().hashCode();
        }
        log.debug("Connection id: {} session id hash: {}", conn.getId(), conn.getSessionId().hashCode());
    }
1199166
public void disconnect(IConnection conn) {
        log.debug("Disconnect: {}", conn);
        // call disconnect handlers in reverse order of connection. ie. roomDisconnect is called before appDisconnect.
        final IClient client = conn.getClient();
        if (client == null) {
            // early bail out
            removeEventListener(conn);
            connectionStats.decrement();
            if (hasParent()) {
                parent.disconnect(conn);
            }
            return;
        }
        // remove it if it exists
        if (clients.remove(client)) {
            IScopeHandler handler = getHandler();
            if (handler != null) {
                try {
                    handler.disconnect(conn, this);
                } catch (Exception e) {
                    log.error("Error while executing \"disconnect\" for connection {} on handler {}. {}", new Object[] { conn, handler, e });
                }
                try {
                    // there may be a timeout here ?
                    handler.leave(client, this);
                } catch (Exception e) {
                    log.error("Error while executing \"leave\" for client {} on handler {}. {}", new Object[] { conn, handler, e });
                }
            }
            // remove listener
            removeEventListener(conn);
            // decrement if there was a set of connections
            connectionStats.decrement();
            if (this.equals(conn.getScope())) {
                final IServer server = getServer();
                if (server instanceof Server) {
                    ((Server) server).notifyDisconnected(conn);
                }
            }
        }
        if (hasParent()) {
            parent.disconnect(conn);
        }
    }
960330
@Handler
    public void onOpenConnection(OpenTcpConnection event) {
        try {
            SocketChannel socketChannel = SocketChannel.open(event.address());
            channels.add(new TcpChannelImpl(socketChannel));
        } catch (ConnectException e) {
            fire(new ConnectError(event, "Connection refused.", e));
        } catch (IOException e) {
            fire(new ConnectError(event, "Failed to open TCP connection.", e));
        }
    }
1344064
public static void closeConnection(Connection con) {
        if (con != null) {
            try {
                con.close();
            } catch (SQLException ex) {
                logger.debug("Could not close JDBC Connection", ex);
            } catch (Throwable ex) {
                logger.debug("Unexpected exception on closing JDBC Connection", ex);
            }
        }
    }
469028
void fireOnOpen(ConnectionEvent e) {
        List<EventListener> listeners = changes.getListenerList(AMQP);
        for (EventListener listener : listeners) {
            ConnectionListener amqpListener = (ConnectionListener)listener;
            amqpListener.onConnectionOpen(e);
        }
    }