Time needed to open a Connection?
2 posts in topic
Flat View  Flat View

Posted By:   Sieijish_Dominic
Posted On:   Tuesday, November 6, 2001 09:18 PM

I am using Oracle thin driver for opening a connection to Database and I am not using connection pooling.

I open a connection to database and close the connection. This takes around 750 milliseconds. Again I open a connection and close it. This time it takes only 65 milliseconds. All subsequent connections take only 65 milliseconds.

Is JDBC caching some information across connections?

Re: Time needed to open a Connection?

Posted By:   Anonymous  
Posted On:   Wednesday, November 7, 2001 12:24 PM

Depends on the driver. If the IP connection is keep-alive, that probably explains it.

Re: Time needed to open a Connection?

Posted By:   Bernie_Acs  
Posted On:   Wednesday, November 7, 2001 12:12 PM

I may be wrong but the Java Object "java.sql.Connection" is being instanciated and implictly opening a connection to the datasource the first time through with the added the overhead of bring this object to life in the local runtime JVM which could account for the decrepancy you have described. IE. the implict ClassLoader function required for the first instance not required for the others, viewable by using verbose opton of the JRE executing test code if you want to parse through it.

To further invetigate you attempt the same test set using various accounts to the same database and then mixing the account used for illiteration one and subsequent connections to determine if the connecton time remains consistant under those circumstances.
About | Sitemap | Contact