The problem of the transcritical flow of a Bose-Einstein condensate through a wide repulsive penetrable barrier is studied analytically using the combination of the localized hydraulic solution of the 1D Gross-Pitaevskii equation and the solutions of the Whitham modulation equations describing the resolution of the upstream and downstream discontinuities through dispersive shocks. It is shown that within the physically reasonable range of parameters the downstream dispersive shock is attached to the barrier and effectively represents the train of very slow dark solitons, which can be observed in experiments. The rate of the soliton emission, the amplitudes of the solitons in the train and the drag force are determined in terms of the BEC oncoming flow velocity and the strength of the potential barrier. A good agreement with direct numerical solutions is demonstrated. Connection with recent experiments is discussed.