>1. Most of the EJB books show the Connection that is obtained from the
>DataSource being closed at the end of the method. Why? If the EJB server is
>responsible for maintaining a pool of database connections, then surely it
>alone should be responsible for adding and removing Connections from this
>pool.
The connection can (and quite often is) a logical connection to a real
physical connection managed by the datasource. When you ask for, and
subsequently close a connection in the EJB, it is actually getting a logical
connection to a physical connection and using it. The close only closes the
logical conection, and not the real physical connection (unless the
datasource's event listener decides there are too many open physical
connections). There are a number of implementations, but generally this is
it.
This is one of the beauties of using the container in the first place. Your
EJB code worries about what it has to do, and the conatiners transaction
manager worries about what the "wired" together components need to do as a
single aggregated transaction. If your EJB internal code where to really
worry about the application transactional details, your component would no
longer be portable.
Thor HW
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".