Solenoid Operation for Hours
There are a couple of solutions to this. The first is to use a specially designed latching solenoid. These typically have a permanent magnet in them so that they can hold in position without power. It's probably the simplest way.

However, you may still be able to use a regular solenoid depending on its design. The force the solenoid exerts is basically proportional to the 1/displacement (though this relationship can be adjusted by shaping the magnetic pole pieces). This means that when the solenoid is disengaged it requires a lot more current to provide the same force to the plunger than when it is fully engaged. Depending on your load and the force-displacement characteristic of the solenoid, you may not need the maximum holding force to keep the solenoid engaged. This means you can reduce the current and hence the amount of heat dissipated in the solenoid coil. If this amount of heat is within a range that can be continuously dissipated by the solenoid then there will be no issue doing this for a long time.

It is quite common in solenoid circuits to have this sort of force/current reduction mechanism, and if you have a well defined load, you can simply reduce the current after a fixed timeout.