OK, I implemented that throughout my app and it worked so long as I kept the
database up, but if I logged into my app, dropped the database and brought
it back up, I would get this:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection
reset by peer: socket write error
 at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
 at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
 at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
 at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.submitRequest(Unknown
Source)
 at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown
Source)
 at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown
Source)
 at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
 at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown
Source)
 at com.microsoft.jdbc.base.BaseStatement.executeQuery(Unknown Source)
 at
com.codestudio.sql.PoolManStatement.executeQuery(PoolManStatement.java:105)

So I implemented a "validationQuery" (I used "select 0") to ensure that
connections were up.  I imagine this will slow things down a hair, but I
think I have a workable solution.

Comments?

----- Original Message -----
From: "Zeltser, Mark" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 11:26 AM
Subject: RE: Can I avoid bouncing app when database goes down? (struts 1.0
.2) (try poolman)


> Ian,
>
> You will need to configure poolman.xml and put it in your
> app/WEB-INF/classes directory.
>
> Then you can do the following:
>
> DataSource dataSource =  PoolMan.findDataSource(
Constants.DATASOURCE_KEY );
> Connection connection =  dataSource.getConnection();
>
> Take a look at docs included with Poolman for configuration options.
>
> Mark.
>
> -----Original Message-----
> From: Ian Hunter [mailto:ihunter@;hunterweb.net]
> Sent: Wednesday, October 30, 2002 11:18 AM
> To: Struts Users Mailing List
> Subject: Re: Can I avoid bouncing app when database goes down? (struts
> 1.0 .2) (try poolman)
>
>
> http://www.codestudio.com/index.shtml allowed me to download it.  That's
so
> weird.
>
> Anyway, is there any way to implement this just by specifying the class in
> struts-config.xml, so I wind up with code like this?
>
>             ds = (PoolmanConnection)
> servlet.getServletContext().getAttribute(Constants.DATABASE_KEY);
>             conn = ds.getConnection();
>
> Or do I have to jump through all kinds of hoops?
>
> ----- Original Message -----
> From: "Ian Hunter" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, October 30, 2002 11:04 AM
> Subject: Re: Can I avoid bouncing app when database goes down? (struts 1.0
> .2) (try poolman)
>
>
> > http://www.codestudio.com says it is no longer supported.  I'll keep
> > looking, but if you have any suggestions...
> >
> > ----- Original Message -----
> > From: "Zeltser, Mark" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > Sent: Wednesday, October 30, 2002 9:49 AM
> > Subject: RE: Can I avoid bouncing app when database goes down? (struts
1.0
> > .2)
> >
> >
> > > I had the same problem. Try using poolman (I had to patch it since it
> was
> > > running in endless loop whenever sybase server was rebooted)
> > >
> > > -----Original Message-----
> > > From: Ian Hunter [mailto:ihunter@;hunterweb.net]
> > > Sent: Wednesday, October 30, 2002 8:39 AM
> > > To: Struts Users Mailing List
> > > Subject: Re: Can I avoid bouncing app when database goes down? (struts
> > > 1.0.2)
> > >
> > >
> > > 1.0.2; kinda old, I guess...
> > >
> > > ----- Original Message -----
> > > From: "James Mitchell" <[EMAIL PROTECTED]>
> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > > Sent: Wednesday, October 30, 2002 12:14 AM
> > > Subject: RE: Can I avoid bouncing app when database goes down?
> > >
> > >
> > > > What version of Struts are you using?
> > > >
> > > > There were some changes made in DBCP a few weeks ago that might help
> > with
> > > > that, but I could be wrong.
> > > >
> > > > James Mitchell
> > > > Software Engineer/Struts Evangelist
> > > > http://www.open-tools.org
> > > >
> > > > "Only two things are infinite, the universe and human stupidity, and
> I'm
> > > not
> > > > sure about the former."
> > > > - Albert Einstein (1879-1955)
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Ian Hunter [mailto:ihunter@;hunterweb.net]
> > > > > Sent: Tuesday, October 29, 2002 11:29 PM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: Can I avoid bouncing app when database goes down?
> > > > >
> > > > >
> > > > > I have struts app that works great until MSDE (MS SQL Server)
drops
> a
> > > > > connection, then I have to reset the whole app.  I'm connecting to
a
> > > > > datasource defined in struts-config.xml and using the ms sql
native
> > jdbc
> > > > > drivers.
> > > > >
> > > > > Any ideas?


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to