OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 142 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 174
Line 370... Line 370...
370
                        }
370
                        }
371
                    }
371
                    }
372
 
372
 
373
                    final long afterQueryInfo = System.nanoTime();
373
                    final long afterQueryInfo = System.nanoTime();
374
                    final long afterExecute, afterHandle;
374
                    final long afterExecute, afterHandle;
375
                    final Statement stmt = conn.createStatement();
-
 
376
                    int count = 0;
375
                    int count = 0;
377
                    try {
376
                    try (final Statement stmt = conn.createStatement()){
378
                        if (Thread.currentThread().isInterrupted())
377
                        if (Thread.currentThread().isInterrupted())
379
                            throw new RTInterruptedException("Interrupted before executing : " + query);
378
                            throw new RTInterruptedException("Interrupted before executing : " + query);
380
                        stmt.execute(query);
379
                        stmt.execute(query);
381
                        afterExecute = System.nanoTime();
380
                        afterExecute = System.nanoTime();
382
                        for (final ResultSetHandler h : handlers) {
381
                        for (final ResultSetHandler h : handlers) {
Line 390... Line 389...
390
                                count += SQLResultSet.getRowProcessedCount(resultSet);
389
                                count += SQLResultSet.getRowProcessedCount(resultSet);
391
                            }
390
                            }
392
                            stmt.getMoreResults();
391
                            stmt.getMoreResults();
393
                        }
392
                        }
394
                        afterHandle = System.nanoTime();
393
                        afterHandle = System.nanoTime();
395
                    } finally {
-
 
396
                        stmt.close();
-
 
397
                    }
394
                    }
398
                    SQLRequestLog.log(query, "executeMultiple", conn, timeMs, time, afterCache, afterQueryInfo, afterExecute, afterHandle, System.nanoTime(), count);
395
                    SQLRequestLog.log(query, "executeMultiple", conn, timeMs, time, afterCache, afterQueryInfo, afterExecute, afterHandle, System.nanoTime(), count);
399
                    return null;
396
                    return null;
400
                }
397
                }
401
            });
398
            });