How can I resize such items without changing the curvature at edges? You know, I don't want the half-circles at the extremes to become half-elipses.
Hold down the shift key while dragging a corner handle.
Or, the more accurate and flexible method is directly selecting all the vector point anchors for one side (2 corners) and dragging that over, then selecting the other half to drag another side in another direction to achieve the desired dimensions.
You can only do that with the "Direct Selection Tool" which is the second, white, "pointer" button in the Illustrator tools palette. It selects points of a shape instead of the whole shape.
Holding Shift while resizing will constrain proportions and keep the ends as semicircles. If your resized shape is too wide, use
Direct Select (A) to select anchors on one side and then move them to where they need to be.
If you need the edges aligned with other objects, the easiest way is to duplicate your resized object and combine the 2 shapes using overlapping areas.
Step 1: The Initial Resize (to get the correct height without distorting your ends)
Step 2 (Option A): Adjust Width Using Direct Selection (move some anchors)
Step 2 (Option B): Adjust Width Using Compount Shapes (good for aligning with other objects)