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 usage during nested method calls

 
Wes Hughes
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say I have a stateless session bean with a method that gets a connection from the data source, makes a database call and then for each record returned calls another method, possibly in another stateless session bean, which does its own database access. In this situation does each connection established correspond to a new physical connection to the database, or is the physical conncection somehow reused amonst these logical connections? This doesn't seem possible though as the first connection is not closed when the second is established.
Is it dependent on the transaction type of the method?

Basically, my concern is that if I have methods calling methods calling methods etc that it will use a lot of physical connections to the database.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic