Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data source, connection and connection pool

 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Whats the difference between data source and connection ?
Thanks in advance
Hari
 
Ken Robinson
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A DataSource is usually a group of Connections. Many web/app severs allow for the creation of a DataSource via a config file/tool.
Basically, if you have an app that access that database frequently, a DataSource is the way to go. If you develop a web store front, you want everyone to be able to view your catalog. It would not be very performant to create a dedicated Connection for each new user. This would cause a large number of new Connections (which is expensive) for a user that will use it only briefly. The DataSource allows a request to grab a Connection, use it, and put it back in the pool when complete. The eliminates the steps of creating a new Connection and storing a possibly high number of Connections.
Most servers allow you to set the number of Connections in a pool at start, the number to increment if that is not enough and a maximum number to user.
 
Fergus Red
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cheers for the help
 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How diffrent is the data source from connection pool ?
Hari
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hari babu:
Hi,
How diffrent is the data source from connection pool ?
Hari

Perhaps you should try this
link. It discusses how to use a pooled connection using a DataSource (3.7 to 3.7.4)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic