Alerts/Notifications

Alerts/Notifications are not getting entered into database. Does anybody have a solution for this? If I insert alerts manually they work. So should I just create an alert within a logic hook? It seems a little more involved than that. It would seem that alerts are created close to the time they are needed. Not sure about the underlying mechanisms but maybe somebody can help clarify whats going on.

Thanks