Thanks for the explanation of connection validation. But it seems the result is still the same... And I did have a small test of purely using jdbc driver to test the failover and it was quite well. Just like I ping the connection pool in glassfish, it just tests the connection via jdbc so it always successes. So I think the problem is as what you said that the connection pool doesn't know that the DB has been failed over. So is there any setting that I can change to let the container quickly know about the DB switching or maybe I need to use the clustering instead of database mirroring?
Thanks!!
[Message sent by forum member 'imyst918' (imyst918)]
http://forums.java.net/jive/thread.jspa?messageID=292682