Under the Glassfish Admin webpage, under Resources -> Connection Pools -> Name of Connection Pool, there is an option for Connection Validation. Click this on and use the appropriate Validation Method. This will insure that your connections are active and working. This way if the database killed the connection in the pool, it will see that it's not valid (i.e. working) and close the connection and pull the next one from the pool until you have a valid connection. This should fix your problem.
[Message sent by forum member 'enderfake' (enderfake_at_yahoo.com)]
http://forums.java.net/jive/thread.jspa?messageID=379618