• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pooling

 
Glenny Dsilva
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried connection pooling according to the documentation given
in tomcat 5.0.18, its working fine.

But in my project I need to connect to 2 databases from one context.
According to a given parameter can i connect to a particular
database using a connection pool.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Different database == different DataSource (and therefore a differernt connection pool). So long as you have two DataSources configured it should be trivial to swap between the two.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can go for two seperate pools.
 
Glenny Dsilva
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot its working fine now

One more doubt I wanna clear is that on mysql server i get the process list

as given below

Id UserHostdbCommand Time

142root localhost:1531javatestSleep10

I cannot understand why do i get the above process list i.e. in Sleep mode

Is it okay or what is the procedure to kill the process or close the connection

I have closed the connection in the class file using con.close()

I have also added the abandoned db connection in the xml code i.e. below

<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic