Reseting Database connection

I noticed if the database is not access for a while, the connection is dropped by the DbVA generated ORM manager and any DB call results in a “Cannot open connection” - What is the best way to re-initialize the connection?
Many thanks,

Joe Rudi

Dear Joe,

Please check if the following options that could be set from the Connection Pool Options dialog box useful or not:

Idle test period - Test connections in the connection pool for every n seconds
Timeout - If connection idle for n seconds, discard this connection

(please take a look at the attachment)

If there are any questions, please feel free to let me know.

Best Regards,
Jick

There’s no attachment. Not sure how this would help. Is the connection suppose to automatically be refreshed if it is dropped by the database?

[quote=Jick]Dear Joe,

Please check if the following options that could be set from the Connection Pool Options dialog box useful or not:

Idle test period - Test connections in the connection pool for every n seconds
Timeout - If connection idle for n seconds, discard this connection

(please take a look at the attachment)

If there are any questions, please feel free to let me know.

Best Regards,
Jick[/quote]

Dear Joe,

Sorry for missing the attachment. Please read again.

Best Regards,
Jick

c_p_20060220.PNG

[quote=Jick]Dear Joe,

Sorry for missing the attachment. Please read again.

Best Regards,
Jick[/quote]

How does this help with dropped connection. If the db is idle for a long time, the connection is dropped and any subsequent calls to the ORMmanager results in cannot open exception.

Hi user,

I guess the problem could be caused by the configuration pool. That’s why I suggested you to modify the setting (Idle test period, timeout…) to see if it helps.

You may also call PersistentManager.disposePersistentManager(). This will reset all sessions.

Best Regards,
Jick

Hi,

could you explain a little bit more how the timeout with 0s and the idle time with 0s has influence to the connections? Are there as much connections created as the max connection value and after that no new connection could be created? SO maybe isn’t it better to have a timeout to kill some useless old connections and allow the creation of new connections?

Which connection pool preferences are the best for an extensive use of the database e.g. the creataion of thousands of elements?

Best regards
Thomas

Hello Thomas,

That means never verify connection and never timeout.

Are there as much connections created as the max connection value and after that no new connection could be created?

Yes, there are as much connection created as the max connection value, and requesting connection will use any idle connection or wait if there are no idle connection.

SO maybe isn’t it better to have a timeout to kill some useless old connections and allow the creation of new connections?

It depends on your db, some db will cause problem if idle for long time.

Which connection pool preferences are the best for an extensive use of the database e.g. the creataion of thousands of elements?

It would be better to have higher max connection for extensive use, if the db and system is allowed.

Best regards,
Jick