6869707172737475767778
hibernate(s, simples, ids, n, "h0"); s.close(); Connection c = cp.getConnection(); directJDBC( c, simples, ids, n, "j0" ); cp.closeConnection(c); s = openSession(); hibernate(s, simples, ids, n, "h0"); s.close();
7677787980818283848586
hibernate(s, simples, ids, n, "h0"); s.close(); c = cp.getConnection(); directJDBC( c, simples, ids, n, "j0" ); cp.closeConnection(c); //Now do timings int N=30;
949596979899100101102103104
time = System.currentTimeMillis(); for (int i=0; i<N; i++) { c = cp.getConnection(); directJDBC( c, simples, ids, n, "j1" ); cp.closeConnection(c); } jdbc += System.currentTimeMillis() - time; time = System.currentTimeMillis(); for (int i=0; i<N; i++) {
110111112113114115116117118119120
time = System.currentTimeMillis(); for (int i=0; i<N; i++) { c = cp.getConnection(); directJDBC( c, simples, ids, n, "j2" ); cp.closeConnection(c); } jdbc += System.currentTimeMillis() - time; time = System.currentTimeMillis(); for (int i=0; i<N; i++) {
126127128129130131132133134135136
time = System.currentTimeMillis(); for (int i=0; i<N; i++) { c = cp.getConnection(); directJDBC( c, simples, ids, n, "j1" ); cp.closeConnection(c); } jdbc += System.currentTimeMillis() - time; }
168169170171172173174175176177178
124125126127128129130131132133134
} catch ( SQLException sqle ) { log.warn( "Could not obtain connection metadata", sqle ); } finally { connections.closeConnection( conn ); } } catch ( SQLException sqle ) { log.warn( "Could not obtain connection to query metadata", sqle ); dialect = DialectFactory.buildDialect( props );
108109110111112113114115116117118
} } } finally { connections.closeConnection(conn); } } catch (SQLException sqle) { log.warn("Could not obtain connection metadata", sqle); }