File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection pooling" Watch "Connection pooling" New topic
Author

Connection pooling

Mortin kim
Ranch Hand

Joined: Nov 15, 2007
Posts: 44
HI.,

Hope all are doing great !

I have one doubt in connection pooling,Like i created a connection poling with 25 connections.all are being engaged with 25 users,now what happens when 26 users wants to the connection..?

2.What is the default connections number in connection pooling..?

KIM.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Like i created a connection poling with 25 connections.all are being engaged with 25 users,now what happens when 26 users wants to the connection.?

That depends on the pool implementation. It might throw an exception, or it might wait until another thread hands back a connection to the pool, and then allow the code to continue.

2.What is the default connections number in connection pooling.?

Each implementation has a different default, but just about all of them allow that number to be configured, so the default doesn't mean much. You should change it to something that suits your need anyway.


Ping & DNS - updated with new look and Ping home screen widget
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

Can you explain more about your application and How do you find out that all 25 connections are in use?

Usually we keep the connection pool size to let usual number of concurrent operation get a connection without waiting for a connection to be released.

when all 25 connections are in use your database operation should wait until a connection get returned to the pool, then the datasource will pick this connection and return it to your application in order to continue the pending operation.

In case that no connection get returned to the pool after some specific time which you determined in the connection pool preference, your datasource.getConnection will return an exception and your client thread future will depend on how you handle the exception.


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection pooling
 
Similar Threads
what is connection pooling?
servlet destroy method and session
Connection Pooling
jdbc-servlets-connection pooling
socket write error