As long as people are heavily incentivized to build boats to exactly the size of the canal (i.e. as long as international shipping exists) the measure isn't actually preventative.
Regarding this, see this other comment: https://news.ycombinator.com/item?id=27173290
One should identify both corrective measures and preventive measures in equal measure.