Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
XWikiBatcher | 37 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package com.xpn.xwiki.store; | |
21 | ||
22 | /* | |
23 | import org.hibernate.jdbc.BatchingBatcher; | |
24 | import org.hibernate.jdbc.JDBCContext; | |
25 | import org.hibernate.jdbc.ConnectionManager; | |
26 | import org.hibernate.HibernateException; | |
27 | import org.hibernate.ScrollMode; | |
28 | import org.hibernate.Interceptor; | |
29 | import org.hibernate.dialect.Dialect; | |
30 | ||
31 | import java.sql.SQLException; | |
32 | import java.sql.ResultSet; | |
33 | import java.sql.PreparedStatement; | |
34 | import java.sql.CallableStatement; | |
35 | */ | |
36 | ||
37 | public class XWikiBatcher | |
38 | { | |
39 | } | |
40 | ||
41 | /* | |
42 | * private static ThreadLocal sqlStats = new ThreadLocal() { protected synchronized Object initialValue() { return new | |
43 | * XWikiBatcherStats(); } }; public static XWikiBatcherStats getSQLStats() { return (XWikiBatcherStats) sqlStats.get(); | |
44 | * } public void addToBatch(int expectedRowCount) throws SQLException, HibernateException { | |
45 | * getSQLStats().incrementAddToBatchCounter(); super.addToBatch(expectedRowCount); } public | |
46 | * XWikiBatcher(ConnectionManager cmgr, Interceptor interceptor) { super(cmgr, interceptor); } public void | |
47 | * abortBatch(SQLException sqle) { getSQLStats().incrementAbortBatchCounter(); super.abortBatch(sqle); } public | |
48 | * CallableStatement prepareCallableStatement(String sql) throws SQLException, HibernateException { | |
49 | * addToPreparedSql(sql); return super.prepareCallableStatement(sql); } private void addToPreparedSql(String sql) { | |
50 | * getSQLStats().addToSqlList(sql); getSQLStats().incrementPreparedSQLCounter(); } public PreparedStatement | |
51 | * prepareStatement(String sql, boolean getGeneratedKeys, String[] param) throws SQLException, HibernateException { | |
52 | * addToPreparedSql(sql); return super.prepareStatement(sql, getGeneratedKeys, param); } public PreparedStatement | |
53 | * prepareSelectStatement(String sql) throws SQLException, HibernateException { addToPreparedSql(sql); return | |
54 | * super.prepareSelectStatement(sql); } public PreparedStatement prepareQueryStatement(String sql, boolean scrollable, | |
55 | * ScrollMode scrollMode) throws SQLException, HibernateException { addToPreparedSql(sql); return | |
56 | * super.prepareQueryStatement(sql, scrollable, scrollMode); } public CallableStatement | |
57 | * prepareCallableQueryStatement(String sql, boolean scrollable, ScrollMode scrollMode) throws SQLException, | |
58 | * HibernateException { addToPreparedSql(sql); return super.prepareCallableQueryStatement(sql, scrollable, scrollMode); | |
59 | * } public PreparedStatement prepareBatchStatement(String sql) throws SQLException, HibernateException { | |
60 | * addToPreparedSql(sql); return super.prepareBatchStatement(sql); } public CallableStatement | |
61 | * prepareBatchCallableStatement(String sql) throws SQLException, HibernateException { addToPreparedSql(sql); return | |
62 | * super.prepareBatchCallableStatement(sql); } public ResultSet getResultSet(PreparedStatement ps) throws SQLException { | |
63 | * getSQLStats().incrementResultSetCounter(); return super.getResultSet(ps); } public ResultSet | |
64 | * getResultSet(CallableStatement ps, Dialect dialect) throws SQLException { getSQLStats().incrementResultSetCounter(); | |
65 | * return super.getResultSet(ps, dialect); } protected void doExecuteBatch(PreparedStatement ps) throws SQLException, | |
66 | * HibernateException { getSQLStats().incrementExecuteBatchCounter(); super.doExecuteBatch(ps); | |
67 | * getSQLStats().resetOnNextSQL(); } } | |
68 | */ |