Causes Of Vibration And Dynamic Shock In Rectangular Connectors
If the application is in a relatively stable environment and is not expected to see any extremes, then almost any connector will work for a specific need. However, when one is doing projects for harsher environments - such as vibration, dynamic shock, shielding, environmental protection, oils, solvents, or a variety of chemical and corrosion, you need to keep these things in mind during the selection process.
For connections within Connector Insert, items with additional features can be selected, such as mounting bosses and other larger solder joints/pins. Omron's XH5 product brief shows a few options that happen to include both types. Starting on page 3, there are drawings of some of the items and the mounting patterns used for each item in order to take advantage of the features of the installation.
For connections entering/leaving the housing, there are a fair number of possible choices for any particular type of connector.
Check the specifications of the connectors being considered to see if they are tested and rated for the shock and vibration levels of your expected project.