return chain.statement_executeUpdate(statement, sql, autoGeneratedKeys);
}
long startMillis = System.currentTimeMillis();
ConnectionProxy connection = statement.getConnectionProxy();
{
TraceEvent event = new TraceEvent("StatementExecuteUpdateBefore", new Date(startMillis));
event.putContext(TRACE_CONN_INFO, connection.getProperties().clone());
event.putContext(TRACE_CONN_CONNECTED_TIME, connection.getConnectedTime());
event.putContext(TRACE_CONN_ID, connection.getId());
event.putContext(TRACE_STMT_ID, statement.getId());
event.putContext(TRACE_STMT_SQL, sql);
event.putContext("stmt.autoGeneratedKeys", autoGeneratedKeys);
fireEvent(event);
}
try {
int updateCount = chain.statement_executeUpdate(statement, sql, autoGeneratedKeys);
long timespan = System.currentTimeMillis() - startMillis;
{
TraceAfterEvent event = new TraceAfterEvent("StatementExecuteUpdateAfter", new Date(startMillis),
timespan);
event.putContext(TRACE_CONN_INFO, connection.getProperties().clone());
event.putContext(TRACE_CONN_CONNECTED_TIME, connection.getConnectedTime());
event.putContext(TRACE_CONN_ID, connection.getId());
event.putContext(TRACE_STMT_ID, statement.getId());
event.putContext(TRACE_STMT_SQL, sql);
event.putContext("stmt.autoGeneratedKeys", autoGeneratedKeys);
event.putContext(TRACE_STMT_UPDATE_COUNT, updateCount);
fireEvent(event);
}
return updateCount;
} catch (SQLException ex) {
{
TraceErrorEvent event = new TraceErrorEvent("StatementExecuteUpdateError", new Date(startMillis), ex);
event.putContext(TRACE_CONN_INFO, connection.getProperties().clone());
event.putContext(TRACE_CONN_CONNECTED_TIME, connection.getConnectedTime());
event.putContext(TRACE_CONN_ID, connection.getId());
event.putContext(TRACE_STMT_ID, statement.getId());
event.putContext(TRACE_STMT_SQL, sql);
event.putContext("stmt.autoGeneratedKeys", autoGeneratedKeys);
fireEvent(event);
}
throw ex;
} catch (RuntimeException ex) {
{
TraceErrorEvent event = new TraceErrorEvent("StatementExecuteUpdateError", new Date(startMillis), ex);
event.putContext(TRACE_CONN_INFO, connection.getProperties().clone());
event.putContext(TRACE_CONN_CONNECTED_TIME, connection.getConnectedTime());
event.putContext(TRACE_CONN_ID, connection.getId());
event.putContext(TRACE_STMT_ID, statement.getId());
event.putContext(TRACE_STMT_SQL, sql);
event.putContext("stmt.autoGeneratedKeys", autoGeneratedKeys);
fireEvent(event);
}