How long the database connection stays open
-
Can somebody tells me how long the connection to the database stays open if the connetion is not closed in the function. If connetion stays open, meanwhile can we do the database restore or backup. Will that cause a problem. Thanks
-
i am not sure but as the expierience says open connections will be closed automatically after sometime that is being idle, for backing up and restore u should close all open connections(u can simply drop the database) ,otherwise u'll recieve error
-
I am not convinced why one need to have database connection closed while performing the database backup. However, database restore make sense. Can you elaborate little more or perhaps a resource that may help me out.
A couple of the most obvious reason for me would be, a database may not flush data to disk until a connection is closed, or a connection could be in the middle of a long running operation, possibbly in a transation or not, backing up the database when this long running operation is in the middle of doing what it needs to.... Your data if you restore it in the backed up state you'll have data corruption.