Shono-
I do not believe S3 can automatically reconnect to the database, I am afraid you need to stop and restart your S3 environment and applications whenever this situation happens.