/// <summary> /// Build the PreparedStatement /// </summary> /// <param name="session">The session.</param> /// <param name="sql">The SQL.</param> public void BuildPreparedStatement(ISession session, string sql) { RequestScope request = new RequestScope( dataExchangeFactory, session, statement); PreparedStatementFactory factory = new PreparedStatementFactory(session, dbHelperParameterCache, request, statement, sql); preparedStatement = factory.Prepare(false); }
/// <summary> /// Build the PreparedStatement /// </summary> /// <param name="session">The session.</param> /// <param name="request">The request.</param> /// <param name="sql">The SQL.</param> /// <returns></returns> private PreparedStatement BuildPreparedStatement(ISession session, RequestScope request, string sql) { PreparedStatementFactory factory = new PreparedStatementFactory( session, dbHelperParameterCache, request, statement, sql); return factory.Prepare(false); }
/// <summary> /// Build the PreparedStatement /// </summary> /// <param name="session">The session.</param> /// <param name="request">The request.</param> /// <param name="commandText">The command text.</param> /// <returns></returns> public PreparedStatement BuildPreparedStatement(ISession session, RequestScope request, string commandText) { if (preparedStatement == null ) { lock(syncLock) { if (preparedStatement==null) { PreparedStatementFactory factory = new PreparedStatementFactory(session, dbHelperParameterCache, request, statement, commandText); preparedStatement = factory.Prepare(false); } } } return preparedStatement; }