Hi,
You need to call close() on your connection when you are done with it.

non-managed --- (connection from Driver or something like
Borland/interbase/interclient non-pooled datasource) -- this closes the db
connection, frees resources.

managed ---(what you should be using with ejbs, for example connection from
a jbosspool datasource as the front end for a pool or a jca resource
adapter) -- this tells the container you are done working with the
connection, the underlying db connection can be returned to the pool for
reuse.


david jencks

On 2001.06.09 08:12:27 -0400 Marcel Schepers wrote:
> Hello,
> 
> What happens when a session bean uses a database
> connection, it gets the connection from a connection pool, creates a
> prepared statement, retrieves all kinds of things, closes the prepared
> statement and returns. In other words, the session bean does not close
> the connection. 
> 
> At the moment I am facing that situation. I have a collection of jsp
> files, some regular Java beans acting as proxy for some ejb's. The
> website starts well, but after a while I get the following error
> message: '[NewsCollection] java.sql.SQLException: Communication link
> failure: java.net.SocketException' (NewsCollection is a session bean
> who uses a java.sql.Connection it gets from a
> javax.sql.DataSource. NewsCollection is the one that does not close
> the connection). I am pretty sure the errors are the result of never
> ever closing a connection. A java.sql.Connection instance does not
> close the connection when the local variable runs out of scope or does
> it? At least not when the connection originates from a connection
> pool. Am I right or am I missing something?
> 
> Have a nice weekend,
> Marcel
> 
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
> 


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to