vic,

thanks for the reply.  let me clarify my problem.  When I create a
connection to the db using connection pooling (as illustrated in my
first email) I could do something like the following...

Connection conn = ds.getConnection();

... use this connection to access the database ...

conn.close();

but this doesn't really close anything, rather it returns the connection
back to the pool for later use.  So that is why I always did something
like this in the destroy method of my plugin...

((BasicDataSource) ds).close();

That would actually kill the connection to the DB after my application
was removed or reloaded on the server.  It turns out that this works for
sqlMaps too.  I just get a reference to the datasource and close it in
the destroy method of the plugin.  If I don't do this, and my
application gets reloaded many times, then I leave behind many
connections to the DB forcing me to bring down tomcat in order to close
them (for my DB admin who gets irate).

It makes me think that I am not doing something at the server level that
I should be doing.  Any ideas?

cheers,
josh
On Tue, 2004-07-27 at 14:31, Vic Cekvenich wrote:
> josh wrote:
> > I am trying to figure out how to use sqlmaps and struts.  Before sqlMaps
> > I would create a connection to the database using a plugin.  In my
> > init() I did something like this
> > 
> > this.ds = (DataSource) context.lookup("java:comp/env/" + lookupString);
> > 
> > This gave me a datasource object that I could use for my app, and I
> > could close the connection in the destroy() method of the plugin to be
> > sure that my connections would get closed up if tomcat were to be
> > restarted.
> > 
> > Now that I use sqlMaps I still use a plugin, but there is no equivalent
> > close function to use in the destroy() method of the plugin. 
> 
> It's becuase SQL maps does it for you!
> 
> You should try it just making connections in SQL maps for now.
> Then, if you want move to having container making a DataSourcePool and 
> SQLMaps just using that pool.
> .V
> 
>   This means
> > that if I remove my app from the server or restart it the old DB
> > connection gets orphaned but doesn't die.  And meanwhile my app gets a
> > new connection to the DB.  How do other people deal with this?  Am I
> > doing this completely wrong?  I can't find anything in the sqlMaps
> > documentation about this.
> > 
> >  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Joshua Cronemeyer
Developer
accessKansas - a service of the Information Network of Kansas, Inc.
www.accesskansas.org <http://www.accesskansas.org/>
785-296-2816 (phone)
785-296-5563 (fax)
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

***********************
CONFIDENTIALITY NOTICE:
This E-mail and any attachments are confidential.  If you are not the
intended recipient, you do not have permission to disclose, copy,
distribute, or open any attachments.  If you have received this E-mail
in
error, please notify us immediately by returning it to the sender and
delete
this copy from your system.

Thank you.
accessKansas
***********************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to