Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes Data source connection usage during nested method calls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Data source connection usage during nested method calls" Watch "Data source connection usage during nested method calls" New topic
Author

Data source connection usage during nested method calls

Wes Hughes
Ranch Hand

Joined: Jul 29, 2002
Posts: 31
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data source connection usage during nested method calls