Data source connection usage during nested method calls
posted 11 years ago
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.