I made an upside-down pineapple cake. It consisted of a layer of buttered caramel, a layer of pineapple pieces, and a layer of batter, baked together. I pressed the batter between the pineapple pieces before baking, hoping that it will "flow in" and keep them in place, but the pineapple was already sunk into the caramel, and it seems to have gotten quite moist during the baking. Result: when I turned the cake, half the pineapple pieces fell off. I replaced them, but I am not sure they will stay in place, even when the caramel hardens a bit, because there is no caramel between the pineapple surface and the cake.
How could I have kept them in place?