Announcement Announcement Module
No announcement yet.
Recovering from Transient Database Outages Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Recovering from Transient Database Outages


    I have set up a test application based on the JPetstore application. It uses the iBatis database mapping layer with a Commons basic data source. The database is MS SQL Server.

    If I shutdown the database and execute an application request, I get an exception that the database connection is reset. So far, so good. However, if I restart the database, the connection is never refreshed until the application is redeployed.

    What should the calling DAO do so that recovery will occur automatically when the database is restarted (without redeploying the application)?



  • #2
    Look in the documentation for the connection pool that you are using. There should be functionality to deal with this issue at the connection pool level.


    • #3
      Hi all,

      I have exactly the same problem apolk had when he sent his post in 2004...
      I am actually planning to refresh the connections in a case of a database crash/recovery by catching the exception, but I would like to know if someone knows some more elegant way of doing it using conf files or properties in iBatis (which would prevent me from having to code )

      Thanks in advance!!!


      • #4
        This might be useful.


        • #5
          Looks interesting... I will probably try to use the testOnBorrow + validationQuery thing. But it might add some non negligeable process time to my global application which has to answer fast to queries ; so I am not sure about this solution...
          Otherwise, what does the object evictor thread exactly and how to use it and to define it???