/** * @param tx Cache transaction. * @return Connection. * @throws SQLException In case of error. */ private Connection connection(@Nullable Transaction tx) throws SQLException { if (tx != null) { Map<String, Connection> props = session().properties(); Connection conn = props.get(ATTR_CONN); if (conn == null) { conn = openConnection(false); // Store connection in session properties, so it can be accessed // for other operations on the same transaction. props.put(ATTR_CONN, conn); } return conn; } // Transaction can be null in case of simple load operation. else return openConnection(true); }
conn = openConnection(false);
/** * @param tx Cache transaction. * @return Connection. * @throws SQLException In case of error. */ private Connection connection(@Nullable Transaction tx) throws SQLException { if (tx != null) { Map<String, Connection> props = session().properties(); Connection conn = props.get(ATTR_CONN); if (conn == null) { conn = openConnection(false); // Store connection in session properties, so it can be accessed // for other operations on the same transaction. props.put(ATTR_CONN, conn); } return conn; } // Transaction can be null in case of simple load operation. else return openConnection(true); }
conn = openConnection(false);