private void createStageIfNeeded() throws BindException
  {
    if (session.getArrayBindStage() != null)
    {
      return;
    }
    synchronized (session)
    {
      // another thread may have created the session by the time we enter this block
      if (session.getArrayBindStage() == null)
      {
        try
        {
          SFStatement statement = new SFStatement(session);
          statement.execute(CREATE_STAGE_STMT, null, null);
          session.setArrayBindStage(STAGE_NAME);
        }
        catch (SFException | SQLException ex)
        {
          // to avoid repeated failures to create stage, disable array bind stage
          // optimization if we fail to create stage for some reason
          session.setArrayBindStageThreshold(0);
          throw new BindException(
              String.format("Failed to create temporary stage for array binds. %s", ex.getMessage()), BindException.Type.UPLOAD);
        }
      }
    }
  }
private void createStageIfNeeded ( ) throws BindException { if ( session . getArrayBindStage ( ) != null ) { return ; } synchronized ( session ) { if ( session . getArrayBindStage ( ) == null ) { try { SFStatement statement = new SFStatement ( session ) ; statement . execute ( CREATE_STAGE_STMT , null , null ) ; session . setArrayBindStage ( STAGE_NAME ) ; } catch ( SFException | SQLException ex ) { session . setArrayBindStageThreshold ( 0 ) ; throw new BindException ( String . format ( "Failed to create temporary stage for array binds. %s" , ex . getMessage ( ) ) , BindException . Type . UPLOAD ) ; } } } }
Check whether the session's temporary stage has been created, and create it
if not.

@throws BindException if creating the stage fails